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

jsx-transform-json

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jsx-transform-json

transform jsx to json and the other way around

latest
Source
npmnpm
Version
1.0.3
Version published
Maintainers
1
Created
Source

jsx-transform-json

Convert React components to JSON and the other way around, compatible with react typescript

CreateJsx(
    <div className='div-class'>
        <span style={{color:'black'}} className='span-class'>
            this is text
        </span>
    </div>
)
CreateJSON({
    type: "div",
    props: {
        className: "div-class",
        style: {},
        children: [
            {
                type: "span",
                key: null,
                ref: null,
                props: {
                    className: "span-class",
                    style: {
                        color: "black"
                    },
                    children: [
                        "this is text"
                    ]
                }
            }
        ]
    },
    key: null,
    ref: null
})

Supported properties

interface NodeJson {
    type: string | Function;
    key?: string | number | null;
    ref?: any;
    props: {
      className: string;
      style?: any;
      children: Array<NodeJson | string>;
    };
  }

Install

npm i jsx-transform-json

Keywords

jsx

FAQs

Package last updated on 09 Apr 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