☑️ Added focus tracking features to address #48. Fields now receive active
and visited
boolean flags. active
is true
when that field currently has focus. visited
is true
when that field has ever had focus. The form component itself also receives an active
prop with the name of the currently active field. Obviously, for this to work, you will need to use the handleFocus
props just like you do with handleBlur
and handleChange
.
☑️ Added readonly
config option to address #49. If you want a component to know about the data or validation state of a form, but not to edit the values of that form, you can set readonly: true
and you will receive only the props that inform about state, and none of the props that are functions that allow mutation of state.
☑️ Added documentation to the README about how to do Dynamic Forms. This was always possible, but non-obvious to implement. This has been one of the most frequently asked questions about this library.