Skip to content

Latest commit

 

History

History
56 lines (40 loc) · 846 Bytes

README.md

File metadata and controls

56 lines (40 loc) · 846 Bytes

React Serialize

serialize and deserialize React components to 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.