Answer the question
In order to leave comments, you need to log in
How to get information in an input and then display it using localStorage in another component?
I enter the login into the input, then by clicking on the button it is saved in localStorage. How can I display the received item named user in another component, when it has already rendered, using localStorage?
Answer the question
In order to leave comments, you need to log in
I enter the login into the input, then by clicking on the button it is saved in localStorage.
localStorage.setItem('inputData', e.target.value)
How can I display the received item named user in another component, when it has already rendered, using localStorage?
const inputData = localStorage.getItem('inputData');
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question