Skip to content

Releases: RadiantGuild/Lib.FormContexts

v0.3.0

05 Nov 03:27
be75fb8
Compare
Choose a tag to compare

Minor Changes

  • #9 406614f Thanks @Alduino! - Added a <NoValidationUpdates> component that disables any validation update calls in its children. See useValidationUpdate’s docs for more info.

v0.2.0

26 May 06:40
8d6c8f2
Compare
Choose a tag to compare

Minor Changes

  • #4 56dbc26 Thanks @Alduino! - Added the useInitialValidationUpdate hook, which can be used to have some validation state that will clear when a new one is set.

    The hook was created for the use-case where you have "instant" validation that can respond as a user types in a value, as well as delayed validation that you can only get e.g. when you submit the form.

    You can still use the normal useValidationUpdate hook for instant validation results, but now instead of using that hook for delayed validation, you call useInitialValidationUpdate.

    When using synchronous validation, this hook will act the same as useValidationUpdate (although it acts as a fallback when the standard funtion is called with null).

    If you use asynchronous validation, the hook becomes a bit more fancy, as it can keep showing the initial validation result until the standard one has finished loading. Specifically, it will show until the next loading state finishes.

    Here's a minimal example to give you an idea of how it might be used:

    // serverSideError is set whenever the user clicks a submit button
    useInitialValidationUpdate(props.serverSideError);
    
    // value is the current value of the input, set in an onChange handler
    const validateResult = useValidation(props.value, props.validators);
    useValidationUpdate(validateResult);

Patch Changes

  • 9f5be6a Thanks @Alduino! - useValidationUpdate is now ignored if useInitialValidationUpdate was just called, so that order doesn't matter.

v0.2.0-beta.1

26 May 06:18
4e9ee9f
Compare
Choose a tag to compare
v0.2.0-beta.1 Pre-release
Pre-release

Patch Changes

  • 9f5be6a Thanks @Alduino! - useValidationUpdate is now ignored if useInitialValidationUpdate was just called, so that order doesn't matter.

v0.2.0-beta.0

24 May 14:22
2cdc522
Compare
Choose a tag to compare
v0.2.0-beta.0 Pre-release
Pre-release

Minor Changes

  • #4 56dbc26 Thanks @Alduino! - Added the useInitialValidationUpdate hook, which can be used to have some validation state that will clear when a new one is set.

    The hook was created for the use-case where you have "instant" validation that can respond as a user types in a value, as well as delayed validation that you can only get e.g. when you submit the form.

    You can still use the normal useValidationUpdate hook for instant validation results, but now instead of using that hook for delayed validation, you call useInitialValidationUpdate.

    When using synchronous validation, this hook will act the same as useValidationUpdate (although it acts as a fallback when the standard funtion is called with null).

    If you use asynchronous validation, the hook becomes a bit more fancy, as it can keep showing the initial validation result until the standard one has finished loading. Specifically, it will show until the next loading state finishes.

    Here's a minimal example to give you an idea of how it might be used:

    // serverSideError is set whenever the user clicks a submit button
    useInitialValidationUpdate(props.serverSideError);
    
    // value is the current value of the input, set in an onChange handler
    const validateResult = useValidation(props.value, props.validators);
    useValidationUpdate(validateResult);

v0.1.3

11 Apr 06:00
e412afb
Compare
Choose a tag to compare

Patch Changes

  • aa4b304 Thanks @Alduino! - Split up the validation context to prevent infinite render loops

v0.1.2

08 Apr 05:25
4b38b86
Compare
Choose a tag to compare

Patch Changes

v0.1.1

08 Apr 04:18
2a762ee
Compare
Choose a tag to compare

Patch Changes

  • bfb4c50 Thanks @Alduino! - Add missing Suspense-using validation that I forgot to implement