@ur-solutions/react-hooks
v1.4.0
Published
# Changelog
Readme
Ur React Hooks
Changelog
v 1.4.0
- Upgrade to React 19
v 1.3.0
- useForm
- Remove
warnOnLocationChangeoption- To remove react-router-dom dependency
- Remove
v 1.2.0
- Package
- Change package name to
@ur-solutions/react-hooks
- Change package name to
v 1.1.3
- useClickOutside
- Improve memoization of hook
v 1.1.2
- useLocale
- Add
onLocaleChangeevent handler touseTranslateProvider- Fires when the
useLocale.setLocalefunction is called
- Fires when the
- Add
v 1.1.1
- useForm
- Add
updateInitialValuesoption toupdateFormfunction- Lets user update initial values immediately after updating form values
- Add
v 1.1.0
- useTranslate
- Add
useLocalehook -Lets user retrieve current locale, and change it viasetLocalefunction - Re-export
useIntlfromuseTranslatehook - BREAKING: Remove
localeprop fromUseTranslateProvider, replaced withinitialLocale - BREAKING: Change
messagesprop onUseTranslateProviderto typeRecord<string, Messages>, making it a map of all locales and their messages
- Add
v 1.0.1
- useForm
- Add
onFormChangeevent
- Add
v 1.0.0
- Stable release
- Upgrade React, ReactDOM, ReactScripts, React Intl
v 0.8.0
- Upgrade to React 18
v 0.7.10
- useForm
- Fix bug in
updateFormValueswhere entire form wasn't validated
- Fix bug in
v 0.7.9
- useForm
- Fix bug in
config.storage.transformValuescallback, where previously whole state wasn't read if there was transforms present- (BREAKING) also fix typo:
tranformValues->transformValues
- (BREAKING) also fix typo:
- Fix bug in
validateFormwith multiple validators for a field
- Fix bug in
v 0.7.7
- useForm
- Improve performance of form validation
- Add option
dontUpdateFormValidForDisabled, which if set will meanformValiddoes not take disabled validators into account. Defaultfalse- Previously it didn't take these values into account, but I figured I should. That means that formErrors for disabled validators will still be
null, butformValidwill reflect correct validity, unless this option is set.
- Previously it didn't take these values into account, but I figured I should. That means that formErrors for disabled validators will still be
v 0.7.5
- useForm
- Fix bug when validating uncahnged field that has disabled validation
v 0.7.4
- useForm
- Add
disableValidationInitiallyconfig param- Disables validation of all or given fields upon initialization
- Add
enableValidationreturn function- Enables validation of given field
- Add
v 0.7.2
- useForm
- Add validator arrays
- Can now add multiple validators to field
- Add validator arrays
v 0.7.0
- useTranslate
- Fix bug where translations didn't update on locale change
v 0.6.3
- useGlobal
- Add dispatcher callback to setter function
- Can now be used like for example
setNumber(v => v + 1)
- Can now be used like for example
- Add dispatcher callback to setter function
v 0.6.2
- useForm
- Reset internal ref
beenEditedonresetForm- To make
onlyValidateAfterFirstUpdatework correctly
- To make
- Reset internal ref
v 0.6.1
- useForm
- Fix bug when using callbacks in multiple forms
v 0.6.0
- useGlobal
- Adds useGlobal hook
- It's a global store, with [value, setValue] syntax like normal state
- Adds UseGlobalProvider for context
- Adds useGlobal hook
v 0.5.2
- useTranslate
- Make given arguments in callback version the defaults
- Message
'common.age': '{age} years old'and useTranslate configage: ['common.age', { age: 21 }]with usagetranslations.age()gives result "21 years old"
- Message
- Make given arguments in callback version the defaults
v 0.5.0
- Upgrade to React 17
v 0.4.9
- useForm
- Add
storage.tranformValuesto config- Transform values on retrieval from storage
- Add
v 0.4.8
- useForm
- Allow using
sessionStorageforuseForm-storage
- Allow using
v 0.4.7
- useForm
- Fix bug where
resetFormdid not use correct values
- Fix bug where
v 0.4.6
- useForm
- Improve
resetForm- Now resets entire form state (errors, valid, etc. as well as values)
- Might be breaking
- Improve
v 0.4.5
- useForm
- Add
includeValidationoption toUpdateFormOptions- Lets user include specified keys in validation on
updateForm/formChangeHandler
- Lets user include specified keys in validation on
- Fix error in second argument of validation functions
- Sometimes old values would be passed
- Fix error in validateForm function
formValiddidn't take entire form into account
- Add
v 0.4.2
- useTranslate
- Make a translation version with both callback values and transformer
v 0.4.1
- Exports
- Make all named
v 0.4.0
- useDebounce
- Add hook
- Delays the update of a value
- Add hook
- TypeScript
- Updated to 4.1.2
v 0.3.8
- useForm
- Add config value
validateImmediately- Validates form immediately upon initialization
- Add config value
v 0.3.7
- useTranslate
- Add transformer message type
- Lets you define a message of type [, (value: string) => string] to transform returned value
- Add transformer message type
v 0.3.6
- useTranslate
- Fix error with literal type inference
v 0.3.5
- useTranslate
- Add support for nested translations
v 0.3.4
- useTranslate
- Fix bug that caused infinite updates if a JSX-element was given as argument
v 0.3.1
- useTranslate
- Add DefaultMessages interface
- This can be overridden by users to get typechecking on message IDs
- Add DefaultMessages interface
v 0.3.0
- useTranslate
- Add UseTranslateProvider component
- A provider to be able to use the
useTranslatehook
- A provider to be able to use the
- Add UseTranslateProvider component
v 0.2.1
- useForm
- Add initAsInvalid config option
- Lets user make
formValidfalseon initialization
- Lets user make
- Add initAsInvalid config option
v 0.2.0
- useForm
- Add updateInitialValues function
- Let's user manually set initial values
- Add updateInitialValues function
v 0.1.3
- useForm
- Add validation by keys to useForm
validateFormfunction- Can input keys of formvalues to validate
- Add validation by keys to useForm
v 0.1.2
- useForm
- Fix typing error in formChangeHandler
v 0.1.0
- Initial publish
