That's not correct. It will be there since its stored in the browser's session memory, not your application's. It will be there until you close the browser (or a new tab). It's like a hidden piece of the URL.
Actually that's how react works, if you refresh the page in any component, the state will reset.
if you're trying to send some data (you get it from the server using fetch API) to another component, and you want to refresh the page or to handle the page from crushing, just fetch again that specific data.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
when the third method is applied, if you refresh the page the state will be undefined.
That's not correct. It will be there since its stored in the browser's session memory, not your application's. It will be there until you close the browser (or a new tab). It's like a hidden piece of the URL.
Actually that's how react works, if you refresh the page in any component, the state will reset.
if you're trying to send some data (you get it from the server using fetch API) to another component, and you want to refresh the page or to handle the page from crushing, just fetch again that specific data.