@poool/oak-react

2.0.1 • Public • Published

🌳 oak

GitHub npm CI codecov


oak-react

A simple wrapper to use Oak inside React

Installation

yarn add @poool/oak @poool/oak-react

Usage

import { useState } from 'react';
import { Builder } from '@poool/oak-react';

export default () => {
  const [value, setValue] = useState([]);

  const onChange = field => {
    setValue(field.value);
  };

  return (
    <Builder
      onChange={onChange}
      value={value}
    />
  );
};

Documentation

<Builder />

Props

  • value {Array} the content you want your Builder to begin with. If you want to start with a empty Builder, pass an empty array.
  • options{Object} (optional) the options you want to pass to the Builder. See options for more information.
  • onChange {Function} (optional) the event listener which will be called when the Builder changes. See onChange event for more information.
  • onImageUpload {Function} (optional) the event listener which will be called when an image is uploaded using the image field type. See onImageUpload event
  • containerProps {Object} (optional) the props you want to pass to the Builder's inner container.

Contributing

Please check the CONTRIBUTING.md doc for contribution guidelines.

License

This software is licensed under MIT.

Readme

Keywords

none

Package Sidebar

Install

npm i @poool/oak-react

Weekly Downloads

13

Version

2.0.1

License

MIT

Unpacked Size

1.53 MB

Total Files

16

Last publish

Collaborators

  • ademduran
  • tyesc
  • simon.poool
  • maximedasilva
  • emile.poool
  • ugo.poool
  • nicolas.poool