Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
react-native-code-highlighter
Advanced tools
Code/Syntax highlighter for React Native. Inspired by react-native-syntax-highlighter, using react-syntax-highlighter
npm install react-native-code-highlighter react-syntax-highlighter
yarn add react-native-code-highlighter react-syntax-highlighter
Additional for typescript
npm install --save-dev @types/react-syntax-highlighter
yarn add -D @types/react-syntax-highlighter
Prop | Description | Type | Optional |
---|---|---|---|
hljsStyle | Highlight.js style imported from react-syntax-highlighter/dist/esm/styles/hljs | { [key: string]: React.CSSProperties } | false |
textStyle | Style for the text text components. Note: color property will be overridden | StyleProp<TextStyle> | true |
scrollViewProps | Props for the underlying scroll view. horizontal is ignored | ScrollViewProps | true |
containerStyle | Deprecated. containerStyle for the underlying ScrollView . Use scrollViewProps.contentContainerStyle instead | StyleProp<ViewStyle> | true |
react-syntax-highlighter Props | Props supported by react-syntax-highlighter. i.e. language |
import React from "react";
import { StyleSheet } from "react-native";
import CodeHighlighter from "react-native-code-highlighter";
import { atomOneDarkReasonable } from "react-syntax-highlighter/dist/esm/styles/hljs";
const CODE_STR = `var hello = "world"`;
export default function HighlightComponent() {
return (
<CodeHighlighter
hljsStyle={atomOneDarkReasonable}
containerStyle={styles.codeContainer}
textStyle={styles.text}
language="typescript"
>
{CODE_STR}
</CodeHighlighter>
);
}
const styles = StyleSheet.create({
codeContainer: {
padding: 16,
minWidth: "100%",
},
text: {
fontSize: 16,
},
});
CodeSandbox: https://codesandbox.io/s/react-native-code-highligher-knfsyx?file=/src/App.js
See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT
FAQs
test
The npm package react-native-code-highlighter receives a total of 553 weekly downloads. As such, react-native-code-highlighter popularity was classified as not popular.
We found that react-native-code-highlighter demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.