ip

immutable-props

React PropTypes for Immutable.js

Showing:

Popularity

Downloads/wk

0

GitHub Stars

97

Maintenance

Last Commit

6yrs ago

Contributors

4

Package

Dependencies

0

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

immutable-props NPM version Downloads Build Status

Information

  • This provides React PropTypes for Immutable.js data.
  • This is the equivalent of React.PropTypes.instanceOf(Immutable.Type) so you can do all the normal stuff
    • .isRequired, nest in .oneOfType, etc.
  • React and Immutable are peer dependencies, so this will not install those for you.
    • This module works with any version of React and Immutable you have installed! 🍺

Install

npm install immutable-props --save

Available Types

  • Iterable
  • Seq
  • Collection
  • Map
  • OrderedMap
  • List
  • Stack
  • Set
  • OrderedSet
  • Record
  • Range
  • Repeat
  • Cursor

Example

ES5

var IPropTypes = require('immutable-props');

var UserPage = React.createClass({
  propTypes: {
    user: IPropTypes.Map,
    friends: IPropTypes.List
  },
  render: function() {
    // ...
  }
});

ES6

import IPropTypes from 'immutable-props'

class UserPage extends React.Component {
  static propTypes = {
    user: IPropTypes.Map,
    friends: IPropTypes.List
  };

  render () {
    // ...
  }
}

ES6 (with destructuring)

import { Map, List } from 'immutable-props'

class UserPage extends React.Component {
  static propTypes = {
    user: Map,
    friends: List
  };

  render () {
    // ...
  }
}

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial