node package manager
Love JavaScript? Your insights can make it even better. Take the 2017 JavaScript Ecosystem Survey »

react-maybe-state

React Maybe State

Kind of like the Maybe monad but for state values. No more (this.state.foo ? (this.state.foo.bar ? f(this.state.foo.bar) : null) : null) boilerplate.

Example
render() {
  return <div>My name this {this.maybeState('identity', 'firstName')} {this.maybeState('identity', 'lastName')}.</div>;
}