
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
react-native-lrc
Advanced tools
The react native component that display lyric from lrc format. Inspired by [Mebtte's react-lrc](https://github.com/mebtte/react-lrc)
The react native component that display lyric from lrc format. Inspired by Mebtte's react-lrc
react >= 16.8 with hookreact-native-web >= 0.11npm install --save react-native-lrc
import React, { useCallback } from 'react';
import { Text } from 'react-native';
import { Lrc } from 'react-native-lrc';
const Lyric = ({ lrc, currentTime }) => {
const lineRenderer = useCallback(
({ lrcLine: { millisecond, content }, index, active }) => (
<Text
style={{ textAlign: 'center', color: active ? 'green' : 'inherit' }}>
{content}
</Text>
),
[],
);
const onCurrentLineChange = useCallback(
({ lrcLine: { millisecond, content }, index }) =>
console.log(index, millisecond, content),
[],
);
return (
<Lrc
style={{ height: 500 }}
lrc={lrc}
currentTime={currentTime}
lineHeight={16}
lineRenderer={lineRenderer}
onCurrentLineChange={onCurrentLineChange}
/>
);
};
export default Lyric;
Lrc Props| prop | description | type | default |
|---|---|---|---|
| lrc | lrc string | string | required |
| lineRenderer | lrc line render method | ({ lrcLine: { id: string, millisecond: number, content: string }, index: number, active: boolean }) => ReactNode | ({ lrcLine: { content }, active }) => (<Text style={{ textAlign: 'center', color: active ? 'green' : '#666' }}>{content}) |
| currentTime | current time | number, millisecond | 0 |
| autoScroll | whether auto scroll | boolean | true |
| autoScrollAfterUserScroll | auto scroll after user scroll | number, millisecond | 6000 |
| onCurrentLineChange | when current line change | ({ index: number, lrcLine: { id: string, millisecond: number, content: string } | null }) => void | null |
| lineHeight | lrc line height | number | 16 |
| activeLineHeight | active lrc line height | number | lineHeight |
| height | lrc container height | number | 500 |
other props | other react-native ScrollView Props | - | - |
Lrc Methods| method | description | type |
|---|---|---|
| scrollToCurrentLine | scroll to current line and set auto scroll | () => void |
| getCurrentLine | get the current lrc line | () => { lrcLine: { id: string, millisecond: number, content: string } | null, index: number } |
import { parseLrc } from 'react-native-lrc';
parseLrc(lrcString); // { id: string, millesecond: number, content: string }[]
import React from 'react';
import { useLrc } from 'react-native-lrc';
const Component = () => {
const lrcLineList = useLrc(lrcString); // { id: string, millesecond: number, content: string }[]
// ...
};
You probably do not give height to Lrc. The height make Lrc scrollable.
<Lrc scrollEnabled={false} autoScrollAfterUserScroll={0} {...otherProps} />
react-native-lrc export type LrcLine.
import React from 'react';
import { LrcLine } from 'react-native-lrc';
const Component = () => {
const lineRenderer = React.useCallback(
({ lrcLine }: { lrcLine: LrcLine }) => {
// ...
},
[],
);
// ...
return <Lrc lineRenderer={lineRenderer} {...otherProps} />;
};
MIT
FAQs
The react native component that display lyric from lrc format. Inspired by [Mebtte's react-lrc](https://github.com/mebtte/react-lrc)
We found that react-native-lrc demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.