Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

reactjs update state example

You have to use setState() for updating state in React
{
  hasBeenClicked: false,
  currentTheme: 'blue',
}

setState({
	hasBeenClicked: true
});
Source by learn.co #
 
PREVIOUS NEXT
Tagged: #reactjs #update #state
ADD COMMENT
Topic
Name
2+8 =