lucasa / React-Serialize

Serialize and deserialize React components into JSON.

Home Page:https://pravdomil.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

React Serialize

Serialize and deserialize React components into JSON.

serialize(
  <div>
    <h1 align="center">
      <blink>Hello</blink>
    </h1>
  </div>
)
deserialize({
  type: "div",
  props: {
    children: {
      type: "h1",
      props: {
        align: "center",
        children: { type: "blink", props: { children: "Hello" } }
      }
    }
  }
})

Install

npm i react-serialize

Example

See CodeSandbox.

API

See src/index.js.

Donate

By buying a beer.

About

Serialize and deserialize React components into JSON.

https://pravdomil.com


Languages

Language:JavaScript 100.0%