Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@empglabs/react-native-jsx-parser

Package Overview
Dependencies
Maintainers
3
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@empglabs/react-native-jsx-parser

Modified JSX Parser to parse JSX string in React Native

  • 10.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
3
Created
Source

react-native-jsx-parser

Modified JSX Parser to parse JSX string in React Native

Install

npm i react-native-jsx-parser --save

Install Dependencies

  • JsxParser by troyalford

npm i react-jsx-parser --save

Usage

// 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

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

Keywords

FAQs

Package last updated on 04 Oct 2021

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc