A practice project focused on React and Web Storage.
Main practice points:
- React Hooks, new API for better React development
- IndexedDB, low-level Web API for client-side storage.
- Constraint Validation, native HTML5 feature for form validation.
If you would like to read more about what I learned with this project please see the Learning document.
PS: since I'm from Brazil the expected currency format is the Brazilian real
Use LocalStorage to read/write current user
Share that information with React useContext hook
Redirect logged users to main app, else show login page
Whenever a user adds/edits/deletes a product, save that change in the IndexedDB
Fake an external API interaction by placing these actions inside a delay/error trap
Use the same database for the same company, even if the username is different
Instead of using a state management library, do it yourself to feel the pain
Combine useState, useEffect and useReducer to create a dedicated Custom Hook
Realize the different types of state that are needed on an application
While learning to use the Constraint Validation interface I came upon this question
Using the SubmitEvent
we can access the input values by the name
property
There is no need to control the input value since the validation will occur before submission
MIT License
Made by Mateus F Torres
Initial structure from barefoot template