New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

react-json-representation

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

react-json-representation

This function takes a react element and returns an json/object representation of its props, children etc.

unpublished
latest
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

react-json-representation

This function takes a react element and returns an json/object representation of its props, children etc.

Install

npm install react-json-representation --save

pnpm install react-json-representation

yarn add react-json-representation --save

Usage


import reactElementToJson from 'react-json-representation`

const jsx = <Page value="Something">
  <Section color="red">
    <Title text="My title" />
  </Section>
</Page>

const json = reactElementToJson(jsx)

/*
output:

{
  type: "Node",
  component: Node, <-- the component function/class
  props: {
    value: "Something"
  },
  children: [
    ......
  ]
}
*/

FAQs

Package last updated on 31 Mar 2023

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