react-dataful

    0.0.8 • Public • Published

    react-dataful

    This is still a module on experiment.

    Usage

    import React from 'react';
    import dataful from 'react-dataful';
     
    const MyForm = ({ data, children }) =>
      (<Form>{children}</Form>);
     
    const EmailInput = ({ data, update }) => (
      <input
        type="email"
        value={data}
        onChange={e => update({ $set: e.target.value })}
      />
    );
     
    const DatafulEmailInput = dataful({ editable: true })(EmailInput);
    const MyDatafulForm = dataful({ editable: true })(MyForm)
     
    ReactDOM.render(
      <MyDatafulForm
        data={{ email: 'abc@xyz.com' }}
        onChange={data => console.log('Data changed:', data)}
      />
        <EmailInput scope={['email']} />
      </MyDatafulForm>
    );

    Keywords

    none

    Install

    npm i react-dataful

    DownloadsWeekly Downloads

    1

    Version

    0.0.8

    License

    MIT

    Last publish

    Collaborators

    • lrills