1Local Storage is key-value storage where key is string and value is string also.
2
3You must stringify your data, you can do this
4
5localStorage.setItem('user', JSON.stringify(user));
6
7
8And get it like
9
10const user = JSON.parse(localStorage.getItem('user'));
11