Open tomByrer opened 3 years ago
Had the same issue on Win10. Haven't tried on other OS. Workaround to still be able to use the library is to import another style mode from /prism instead of /hljs
The following code worked for me:
import SyntaxHighlighter from 'react-native-syntax-highlighter';
import { darcula } from 'react-syntax-highlighter/styles/prism'; // note the difference here
export default function App() {
return (
<View style={styles.container}>
<SyntaxHighlighter
language='javascript'
style={darcula}
highlighter={"prism" || "hljs"}
>
Hello World!
</SyntaxHighlighter>
<StatusBar style="auto" />
</View>
);
}
Win10, both Expo targeting web & Next.js with React-Native-Web won't run your library. I used only the demo you have in README.