How to set value in local storage while component unmounting

Viewed 104

In my component, searchBar, i record user input in this.state.value. My task is to set this.state.value in localStorage.value while component unmounting(componentWillUnmount), plus after tab refreshed i must display localStorage.value in search bar. No hooks are allowed. Im really stuck, please help.

0 Answers
Related