Skip to content

A React serializer for a Formalist-compatible abstract syntax tree.

Notifications You must be signed in to change notification settings

team-formalist/formalist-serialize-react

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

91 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Formalist Serialize React

A React serializer for a Formalist-compatible abstract syntax tree. It’ll take your complex, nested AST and output a series of flat hidden-inputs.

Usage

import serialize from 'formalist-serialize-react'
const data = [...] // Formalist compatible AST
serialize(data)
// <input name="foo" value="bar" type="hidden"/>

You can set a prefix for the input names:

let options = {
  prefix: "user"
}
serialize(data, options)
// <input name="user[foo]" value="bar" type="hidden"/>

Tests

$ npm run test

About

A React serializer for a Formalist-compatible abstract syntax tree.

Resources

Stars

Watchers

Forks

Packages

No packages published