react-stateless
Helpers to write stateless functional components in React.
Write stateless functional components in React with lifecycle methods as pure functions!
ReactStateless.createClass(specification)
specification
can be a stateless render function
or an object containing pure stateless lifecycle functions.
Example: component as a function
;; { return <div> propsname </div>;} // React 0.14// OrComponentA;
Example: component as an object
;; { return propsname !== nextPropsname;} { return <div> propsname </div>;} shouldComponentUpdate render
Supported properties
propTypes
defaultProps
displayName
(automatically detected by if your component function or render function is named)
Supported methods
componentWillMount(props)
componentDidMount(props, refs)
componentWillReceiveProps(props, nextProps, refs)
shouldComponentUpdate(props, nextProps, refs)
componentWillUpdate(props, nextProps, refs)
componentDidUpdate(props, prevProps, refs)
componentWillUnmount(props, refs)