2.2.0-rc.1
Pre-releaseThis is more or less a consolidation release. After using the library for a while and encountering different scenarios I have come to the conclusion that some adjustments need to be made to improve it.
Hook Naming and Unification
With this release I am unifying the view model related hooks under a single useViewModel
one. The useViewModelType
, useViewModelFactory
, and watchViewModel
hooks have been marked as deprecated and their implementation is now based on the useViewModel
one. They will continue to function the exact same way, however they will be removed with the next major release.
The new useViewModel
hook has 3 overloads, we can now specify deps and constructor arguments (which also act as deps), for more info see the documentation.
All hooks will follow the proper naming conventions, the ones that do not follow the conventions have been marked as deprecated and will be removed with the next major release. For more information see Reusing Logic with Custom Hooks - Hook names always start with use
.
Form Field Flag Deprecations
The .isFocused
and .isTouched
flags have been marked as deprecated. The former is not exactly a UI logic concern, but rather a purely UI presentation concern, the components handle the focus state of the inputs, not the view model. The latter was removed as not all forms may need this and can easily be added back, along side any other desired properties, though form extensibility.
Form Extensibility
Forms have been updated to allow easier extensibility, the base types are still available, however it is easier to have custom fields and reuse/extend the form field collection type.
For more information around the reasoning around these decisions see the Discussions / React [email protected] announcement.