Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

update state in react

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

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