I want to show one component only if a value ('id') is stored in the localStorage. And id is stored when the button is clicked.
{localStorage.getItem('id') != null ? <Game/> : null }
It works fine, so I click the button and store the id in localStorage but only after I refresh I am able to see component. But I want to render the component as soon as it is stored in local (refresh the page shouldnt be needed)
Any suggest to do it?