replaceState
  • References/JavaScript/React/Component

replaceState void replaceState( object nextState, [function callback] )

2025-01-10 15:47:30
Immutability Helpers
  • References/JavaScript/React/Guides

React lets you use whatever style of data management you want, including mutation. However, if you can use immutable data in performance-critical parts of your application

2025-01-10 15:47:30
Refs to Components
  • References/JavaScript/React/Guides

After building your component, you may find yourself wanting to "reach out" and invoke methods on component instances returned from render(). In most cases, this

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

Updating: componentDidUpdate void componentDidUpdate( object prevProps, object prevState

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

React.cloneElement ReactElement cloneElement( ReactElement element, [object props]

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

One of React's biggest strengths is that it's easy to track the flow of data through your React components. When you look at a component, you can easily see exactly which props

2025-01-10 15:47:30
JSX Gotchas
  • References/JavaScript/React/Guides

JSX looks like HTML but there are some important differences you may run into. For DOM differences, such as the inline style

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

Form components such as <input>, <textarea>, and <option> differ from other native components because they can be mutated

2025-01-10 15:47:30
Communicate Between Components
  • References/JavaScript/React/Tips

For parent-child communication, simply pass props. For child-parent

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

if-else statements don't work inside JSX. This is because JSX is just syntactic sugar for function calls and object construction. Take this basic example:

2025-01-10 15:47:30