Socket
Socket
Sign inDemoInstall

react-tree-es6

Package Overview
Dependencies
4
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    react-tree-es6

The wrapper of jsTree (jstree.com) for React


Version published
Weekly downloads
2
increased by100%
Maintainers
1
Install size
42.9 MB
Created
Weekly downloads
 

Changelog

Source

v1.1.0

Full Changelog

Implemented enhancements:

  • Remove Gulp dependency #25
  • Create GitHub Page #6

Readme

Source

react-tree-es6

Build Status codecov dependencies Status CII Best Practices

If you want to find a tree view component for React, this module is what you need.

Getting Started

It ONLY supports ES6 and above. Read https://hckhanh.github.io/react-tree-es6 for more details.

Installation

npm install --save react-tree-es6

Usage

const CORE = {
  data: [
    'Simple root node',
    {
      text: 'Root node 2',
      state: {
        opened: true,
        selected: true
      },
      children: [
        {
          text: 'Child 1'
        },
        'Child 2'
      ]
    }
  ]
};

class ExampleApp extends React.Component {
  constructor(props) {
    super(props);

    this.state = { items: [] };

    this.handleOnChanged = this.handleOnChanged.bind(this);
  }

  handleOnChanged(changedItems) {
    this.setState({
      items: changedItems.map(item => item.text).join(', ')
    });
  }

  render() {
    return (
      <div>
        <ReactTree core={CORE} onChanged={this.handleOnChanged} />
        <div>Selected items: {this.state.items}</div>
      </div>
    );
  }
}

License

MIT

Keywords

FAQs

Last updated on 19 Aug 2016

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc