save data in local storage reactjs returns [object, object]
Local Storage is key-value storage where key is string and value is string also.
You must stringify your data, you can do this
localStorage.setItem('user', JSON.stringify(user));
And get it like
const user = JSON.parse(localStorage.getItem('user'));
Also in JavaScript:
- react spring transition animations
- javascript change background color
- SFC in react
- afficher un div qui etait cache en javascript
- Elements in iteration expect to have 'v-bind:key' directives
- npm ERR! Unexpected end of JSON input while parsing near '...rity":"sha512-o7nOSN0
- jquery empecher revoie du formulaire
- go to new page javascript
- validate json file programmatically in python
- js make radio checked
- remove backslash in json array javascript
- service worker.js
- mock sqs.sendMessage node js
- javascript split
- string interpolation
- js data object length
- datatable dropdown toggle not working
- button click javascript by class
- collision detection three js
- how to display javascript variable value in html page
- node js check type of variable
- create a form and submit it dynamically jquery
- js class async constructor
- generate random number jquery