useState

useState belongs to functional component. it doesn't merge with the old state instead it replaces the old one.

but in class-based component, setState merges the object passed with the previous states. but we can use multiple useState useState also doesn't need to recieve an object unlike setState which recieves only object.