RN Syntax Highlighter
Syntax highlighting component for React Native
using react-syntax-highlighter
Install
npm install @godievski/rn-syntax-highlighter --save
npx pod-install
Use
props
Accepts almost all of the same props as react-syntax-highlighter
with some additional props.
-
fontFamily
(string) - the font family to use for syntax text. -
fontSize
(number) - the fontSize for syntax text. -
dark
(boolean) - darkmode for the numbers of the lines -
startingLineNumber
(number) - number from the line numbering will start -
highligter
(string) - defaults to rendering with vdom created from highlightjs, but can pass inprism
as alternate option. You can see more about dealing with the prism highlighter in the docs for react-syntax-highlighter but one of the main uses would be better support for jsx