github refinedev/refine @refinedev/chakra-ui@2.22.0

Minor Changes

  • #4591 f8891ead2bd Thanks @yildirayunlu! - feat: autoSave feature for Edit.
    useForm, useDrawerForm, useModalForm, useStepsForm hooks now accept autoSave object. enabled is a boolean value and debounce is a number value in milliseconds. debounce is optional and default value is 1000.

    const { autoSaveProps } = useForm({
        refineCoreProps: {
            autoSave: {
                enabled: true,
                debounce: 2000, // not required, default is 1000
            },
        }
    });
    
    return (
        <Edit
            saveButtonProps={saveButtonProps}
            // pass autoSaveProps to Edit component
            autoSaveProps={autoSaveProps}
        >
            // form fields
        </Edit>
    );
    

    feat: Add <AutoSaveIndicator> component. It comes automatically when autoSaveProps is given to the Edit page. However, this component can be used to position it in a different place.

    import { AutoSaveIndicator } from "@refinedev/chakra-ui";
    const { autoSaveProps } = useForm({
        refineCoreProps: {
            autoSave: {
                enabled: true,
                debounce: 2000, // not required, default is 1000
            },
        }
    });
    
    return (
        <div>
            <AutoSaveIndicator {...autoSaveProps}>
        </div>
    );
    

Patch Changes

Don't miss a new refine release

NewReleases is sending notifications on new releases.