New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

react-linkstate-decorator

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-linkstate-decorator

Enables two way binding on decorated components via linkState and valueLink.

latest
Source
npmnpm
Version
0.0.4
Version published
Weekly downloads
6
20%
Maintainers
1
Weekly downloads
 
Created
Source

Build Status Code Climate Test Coverage Dependency Status devDependency Status

react-linkstate-decorator

Enables two way binding on decorated components via linkState and valueLink.

Installation

Run <npm install --save react-linkstate-decorator> and then use the default export of the module.

Purpose

This will allow two way data flow between decorated components via linkState and valueLink. This will assign a createlinkState method to the component's linkState attribute for easy use. For more information about linkState and the valueLink property, please visit [https://facebook.github.io/react/docs/two-way-binding-helpers.html] (https://facebook.github.io/react/docs/two-way-binding-helpers.html).

Example

Using the decorator, you can enable a two way binding via valueLink and linkState between a parent and child component.

import LinkState from 'react-linkstate-decorator';

class ChildComponent extends Component {
  render() {
    return (
      <div>{this.props.valueLink.value}</div>
    );
  }
}

@LinkState
class ParentComponent extends Component {
  constructor() {
    super();
    this.state = {
      val: 1
    };
  }

  render() {
    return (
      <ChildComponent valueLink={this.linkState('val')}/>
    );
  }
}

FAQs

Package last updated on 19 Apr 2016

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