Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
@empglabs/react-native-jsx-parser
Advanced tools
Modified JSX Parser to parse JSX string in React Native
Modified JSX Parser to parse JSX string in React Native
npm i react-native-jsx-parser --save
npm i react-jsx-parser --save
// Use import or require()
import RNJsxParser from 'RNJsxParser';
// Import all the components needed in the string
// Example:
import { PostCard, CommentCard } from './customComponents
// Define the components objects
const postComponents = { PostCard, CommentCard }
// Define the bindings if you have
const postBindings = { lorem: 'ipsum', handleEvent: () => { /* */ } }
// The Jsx String, you could also store and fetch from JSON file
// Just remember to wrap with React Fragment <> </>
const stringJsx = '<><PostCard> Hello </PostCard> <CommentCard/></>'
<RNJsxParser bindings={postBindings} components={postComponents} jsx={stringJsx} />
Props is all the same as react-jsx-parser, but only allow 3 props bindings
, components
and jsx
. You could use other props by editing the file inside node_modules/react-native-jsx-parser.
See the available react-jsx-parser Here
FAQs
Modified JSX Parser to parse JSX string in React Native
We found that @empglabs/react-native-jsx-parser demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 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.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.