ReactDOMServer.renderToString
  • References/JavaScript/React/React

ReactDOMServer.renderToString string renderToString(ReactElement element)

2025-01-10 15:47:30
Shallow Compare
  • References/JavaScript/React/Guides

shallowCompare is a helper function to achieve the same functionality as PureRenderMixin while using ES6 classes with React. If

2025-01-10 15:47:30
Test Utilities
  • References/JavaScript/React/Guides

ReactTestUtils makes it easy to test React components in the testing framework of your choice (we use

2025-01-10 15:47:30
ReactDOM.unmountComponentAtNode
  • References/JavaScript/React/React

ReactDOM.unmountComponentAtNode boolean unmountComponentAtNode(DOMElement container)

2025-01-10 15:47:30
Performance Tools
  • References/JavaScript/React/Guides

React is usually quite fast out of the box. However, in situations where you need to squeeze every ounce of performance out of your app, it provides a shouldComponentUpdate

2025-01-10 15:47:30
Props in getInitialState Is an Anti-Pattern
  • References/JavaScript/React/Tips

This isn't really a React-specific tip, as such anti-patterns often occur in code in general; in this case, React simply points them out more clearly.

2025-01-10 15:47:30
isMounted
  • References/JavaScript/React/Component

isMounted boolean isMounted() isMounted()

2025-01-10 15:47:30
False in JSX
  • References/JavaScript/React/Tips

Here's how false renders in different situations: Renders as id="false":

2025-01-10 15:47:30
Special Non-DOM Attributes
  • References/JavaScript/React/Reference

Beside DOM differences, React offers some attributes that simply don't exist in DOM.

2025-01-10 15:47:30
React.PropTypes
  • References/JavaScript/React/React

React.PropTypes React.PropTypes includes types that can be used with a component's propTypes object to validate props

2025-01-10 15:47:30