Confirmed users
508
edits
No edit summary |
|||
Line 154: | Line 154: | ||
=== Components === | === Components === | ||
* Default to creating components as [https://facebook.github.io/react/docs/reusable-components.html#stateless-functions stateless function components]. | * Default to creating components as [https://facebook.github.io/react/docs/reusable-components.html#stateless-functions stateless function components]. | ||
* If you need local state | * If you need local state or lifecycle methods, use `React.createClass` instead of functions. | ||
* Use React.DOM to create native elements. Assign it to a variable named `dom`, and use it like `dom.div({}, dom.span({}))`. You may also destructure specific elements directly: `const { div, ul } = React.DOM`. | |||
=== PropTypes === | === PropTypes === |