Byteclaw / forms

📋 Easily built forms in React using Hooks API
https://www.npmjs.com/package/@byteclaw/forms
MIT License
8 stars 0 forks source link

Investigate using more complex reducer with nested fields #34

Open michalkvasnicak opened 4 years ago

michalkvasnicak commented 4 years ago

Basically store the whole form values state and use form reducer to dispatch actions over all fields, etc. Then just reflect the state of a field in local field state so we can easily read a field state without need to hack the state.

michalkvasnicak commented 4 years ago

Field state will be the same value as in form state for given field. Changed could be tracked by incremental id of field state so we don't need expensive checks if something changed.