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

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