How can you update state in react js ?

A state can be updated on the component directly or indirectly.