Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Component state should only contain volatile data that is not important to save, the opposite of LocalStorage.

Where do you store data that you retrieve from a server for rendering? Storing it in the state is perfectly fine. In this example, data is retrieved from local storage and stored in the state.



Fair point, but server state is tied ti my account, LS is not. You can tie LS to the account, but IMO that would be out of scope for an "everything component" approach, like the article.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: