/localstate-react-examples

Examples of Mvstate used with React

Primary LanguageJavaScriptMIT LicenseMIT

Localstate React Examples

Localstate started with React in mind. These examples show how nicely React and Localstate play together. See src/examples for examples. Feel free to add your own through a PR. This whole project is a create-react-app project. Clone the project, do a "npm i" followed by "npm start" and you should have it up and running.

I'd recommend having a look at Counter first. This is kind of the Hello World of Localstate. TicTacToe is a more advanced example to show you a clear separation of view and "business" logic. Checkout is an example of a multi-step form.

When looking at the examples, pay attention to what kind of code you find in the component versus in the model. Note the separation of view and "business" logic.

Cheers, Peter