Skip to content

hadihallak/React-Serialize

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Serialize and deserialize React components to JSON

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%