Navigator Prefabricating Marinates
    Wondering what’s next for npm?Check out our public roadmap! »

    @rcp/hoc.uncontrolled
    TypeScript icon, indicating that this package has built-in type declarations

    2.1.10 • Public • Published

    @rcp/hoc.uncontrolled

    NPM version NPM Downloads

    The high order component for creating uncontrolled component

    Installation

    npm install @rcp/hoc.uncontrolled
    # or use yarn 
    yarn add @rcp/hoc.uncontrolled

    Usage

    import uncontrolled from '@rcp/hoc.uncontrolled'
     
    // `props.defaultValue` and `props.value`
    // could be assigned to `this.state.value` in `constructor` and `componentWillReceiveProps` automatically.
    @uncontrolled(['value'])
    class Input extends React.Component {
      render() {
        return <input value={this.state.value} />
      }
    }

    API

    uncontrolled

    Parameters

    • propList {Prop[]} eg. ['value'] / [{ name: 'value', withDefault: false, eq: (a, b) => a === b }]

    Returns Function (Component: React.ComponentClass) => React.ComponentClass

    Related

    Authors

    This library is written and maintained by imcuttle, mailto:moyuyc95@gmail.com.

    License

    MIT

    Install

    npm i @rcp/hoc.uncontrolled

    DownloadsWeekly Downloads

    17

    Version

    2.1.10

    License

    MIT

    Unpacked Size

    29.7 kB

    Total Files

    14

    Last publish

    Collaborators

    • avatar