Releases: akshay-nm/use-form-state
Releases · akshay-nm/use-form-state
Breaking Changes: Switch to named exports
- Switch to typscript! (the library now has types)
- Add a hook which exposes state related to a single text input aka useTextInputState
- Switch to named imports. useFormState is no longer accessible as default import.
- The library now exports 2 hooks
useTextInputState
useFormState
You can import both of them like:
import { useFormState, useTextInputState } from '@akshay-nm/use-form-state'
Fix states not being updated
No breaking changes, bug fix.
v2.1.1-rc
Now users can access whether a particular state is valid on not
The hook does validations asynchronously, so the value of showVariableWarning
doesn't necessarily indicate whether a value is valid or not. Sometimes users might be interested in the validity of the value for example in the case of multistep forms.
Before this release you could only access;
- the value of the state variable
- whether to show a warning for a state variable
But there was no way to know whether the state variable is valid at a given instant.
This release fixes this issue by exposing an isVariableValid
property for each variable
configured during hook initialization.
Contributing, security, and code of conduct
Merge pull request #2 from akshay-nm/docs Docs
Potentially breaking changes
- Switched to object export
- Switch to object type configuration
- Improve docs
No need to create a wrapper, you can now directly pass the configuration touseFormState
and expect field named stuff.
Add /dist
Update documentation
- Replace the example generated by create-react-library with the actual example.
First Release!
- declare state params as an object and pass it to hook
- check the example for more details