Multiple Components
  • References/JavaScript/React/Guides

So far, we've looked at how to write a single component to display data and handle user input. Next let's examine one of React's finest features: composability.

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

If you know all the properties that you want to place on a component ahead of time, it is easy to use JSX:

2025-01-10 15:47:30
Self-Closing Tag
  • References/JavaScript/React/Tips

In JSX, <MyComponent /> alone is valid while <MyComponent> isn't. All tags must be closed, either with the self-closing format or with

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

React React is the entry point to the React library. If you're using one of the prebuilt packages it's available

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

React.createElement ReactElement createElement( string/ReactClass type, [object props]

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

getInitialState object getInitialState() Invoked

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

setProps void setProps( object nextProps, [function callback] )

2025-01-10 15:47:30
Event System
  • References/JavaScript/React/Reference

SyntheticEvent Your event handlers will be passed instances of SyntheticEvent, a cross-browser wrapper

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

React provides a ReactTransitionGroup add-on component as a low-level API for animation, and a ReactCSSTransitionGroup for easily implementing basic

2025-01-10 15:47:30
Shorthand for Specifying Pixel Values in style props
  • References/JavaScript/React/Tips

When specifying a pixel value for your inline style prop, React automatically appends the string "px" for you after your number value, so this works:

2025-01-10 15:47:30