New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

baobab-react-schemabranchmixin

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

baobab-react-schemabranchmixin

SchemaBranchMixin for baobab-react. Mixin allows to define schema for branch component

1.0.10
latest
Source
npm
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

Build Status Coverage Status npm version

baobab-react-schemabranchmixin

SchemaBranchMixin based on baobab-react

Installation

npm install baobab --save

npm install baobab-react --save

npm install baobab-react-schemabranchmixin --save

Usage

SchemaCursorMixin is designed for use with baobab-react mixin branch. General purpose of mixin is tree autogeneration with schema.

This mixin add cursors from component schema for tree component prop or root tree.

Our tree (auto-generated from schema):

{
 globalVal: 'global value (predefined)',
 form: {
   name: '',
   externalId: ''
 }
}

Example of usage:

const EditForm = React.createClass({
 mixins: [SchemaBranchMixin],
 schema: {
   name: '',
   externalId: ''
 },
 cursors: {
   globalVal: ['globalVal']
 },
 render: function () {
   We have this.cursors.globalVal (via baobab-react branch mixin)
   And we have `this.cursors.name`, `this.cursors.externalId` via
   SchemaBranchMixin.
   `this.state.name` and others state params contains value from
   appropriate cursor via baobab-react branch mixin

   If `tree` props is not received from child component, global tree will
   be used
 }
});

const Page = React.createClass({
  mixins: [SchemaBranchMixin],

  schema: {
    form: {}
  },

  render: function () {
    return (<EditForm tree={this.cursors.form} />);
  }
});

Tests

npm test

Release History

  • 1.0.10 Fix #6
  • 1.0.9 Fixed problem with cursors definition as function
  • 1.0.8 Fixed problems with nested schema default values
  • 1.0.7 Fixed problems with monkey
  • 1.0.6 Added baobab-prop-types deps
  • 1.0.4 Added PropTypes to export
  • 1.0.3 Fixed deps
  • 1.0.2 Initial release

Keywords

react

FAQs

Package last updated on 22 May 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts