in React JS by
Q:

What is the difference between setState() and replaceState() methods?

1 Answer

0 votes
by

When you use setState() the current and previous states are merged. replaceState() throws out the current state, and replaces it with only what you provide. Usually setState() is used unless you really need to remove all previous keys for some reason. You can also set state to false/null in setState() instead of using replaceState().

Click here to read more about React JS
Click here to read more about Insurance

Related questions

0 votes
asked Jun 4, 2020 in Data Handling by SakshiSharma
0 votes
asked Aug 22, 2019 in Selenium by john ganales
0 votes
asked Jul 2, 2019 in React JS by Venkatshastri
0 votes
asked Mar 30, 2020 in React JS by amita rallin
0 votes
asked Mar 3, 2020 in React JS by miceperry
...