Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs_headless/src/content/docs/AutoSaveBase.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ The app will save the current form values after 3 seconds of inactivity.
- You must set the `<Form resetOptions>` prop to `{ keepDirtyValues: true }`. If you forget that prop, any change entered by the end user after the autosave but before its acknowledgement by the server will be lost.
- In an `<EditBase>` page, you must set [`mutationMode`](https://marmelab.com/ra-core/editbase/#mutationmode) to `pessimistic` or `optimistic` (`<AutoSaveBase>` doesn't work with the default `mutationMode="undoable"`).
- You can't use `<Form warnWhenUnsavedChanges>` with this component. `<AutoSaveBase>` implements its own similar mechanism, and it's enabled by default. You can disable it with the [`disableWarnWhenUnsavedChanges` prop](#disablewarnwhenunsavedchanges).
- It requires that you use a Data Router. This is the default for react-admin apps, but if you're using a custom router, you may need to adjust your configuration. Check the react-router documentation about [Using a Data Router with react-router v6](https://reactrouter.com/6.22.3/routers/picking-a-router) or [Using a Data Router with react-router v7](https://reactrouter.com/7.2.0/start/framework/custom).
- It requires a router that supports navigation blocking. This is the case with the default router provided by react-admin. If you set up your own react-router router, it must be a [Data Router](https://reactrouter.com/6.22.3/routers/picking-a-router). Other `routerProvider` implementations expose their support through `useCanBlock()`.

## Props

Expand Down
2 changes: 1 addition & 1 deletion docs_headless/src/content/docs/useAutoSave.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Note that you **must** add the `resetOptions` prop with `{ keepDirtyValues: true
**Note**: `useAutoSave` is not compatible with the default `warnWhenUnsavedChanges` prop of the react-admin form components. However, it implements its own similar mechanism which is enabled by default.
You can disable it with the [`disableWarnWhenUnsavedChanges` prop](#disablewarnwhenunsavedchanges).

**Note**: Due to limitations in react-router, this equivalent of `warnWhenUnsavedChanges` only works if you use the default router provided by react-admin, or if you use a [Data Router with react-router v6](https://reactrouter.com/6.22.3/routers/picking-a-router) or [with react-router v7](https://reactrouter.com/7.2.0/start/framework/custom).
**Note**: This equivalent of `warnWhenUnsavedChanges` needs a router that supports navigation blocking. It works with the default router provided by react-admin. If you set up your own react-router router, it must be a [Data Router](https://reactrouter.com/6.22.3/routers/picking-a-router).
If not, you'll need to use the `disableWarnWhenUnsavedChanges` prop.

```tsx
Expand Down
Loading