React State
Learn what state means in a React application.
We'll cover the following...
React state
React has a built-in state
object. This state
object is where we store values that relate to a component. The rendering of a React component depends on its state
. When the state
of a component changes, the component rerenders.
import React from 'react'; require('./style.css'); import ReactDOM from 'react-dom'; import App from './app.js'; ReactDOM.render( <App />, document.getElementById('root') );
Hello World React application
The widget above is a class-based React component. Remember that there are two ways of creating a React component, which are by using Javascript classes
and ...