formalist-serialize-react

1.0.6 • Public • Published

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

/formalist-serialize-react/

    Package Sidebar

    Install

    npm i formalist-serialize-react

    Weekly Downloads

    214

    Version

    1.0.6

    License

    MIT

    Unpacked Size

    42.8 kB

    Total Files

    13

    Last publish

    Collaborators

    • andrewcroome
    • narindajane
    • makenosound