Skip to content

Commit d4db414

Browse files
committed
[Doc] Backport AutoPersistInStore doc update
1 parent d4118e7 commit d4db414

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

docs/AutoPersistInStore.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@ title: "The AutoPersistInStore Component"
55

66
# `<AutoPersistInStore>`
77

8-
This [Enterprise Edition](https://react-admin-ee.marmelab.com)<img class="icon" src="./img/premium.svg" alt="React Admin Enterprise Edition icon" /> component prevents data loss in forms by automatically saving the form data in the store when users navigate away from the page. When users return to the page, it reapplies the saved data to the form.
8+
This [Enterprise Edition](https://react-admin-ee.marmelab.com)<img class="icon" src="./img/premium.svg" alt="React Admin Enterprise Edition icon" /> component prevents data loss in forms by automatically saving the form data in the store when users update it. When users return to the page, it reapplies the saved data to the form.
99

1010
<video controls autoplay playsinline muted loop>
1111
<source src="./img/AutoPersistInStore.mp4" type="video/mp4"/>
1212
Your browser does not support the video tag.
1313
</video>
1414

15-
The temporary form data is only saved when the user navigates away from the page, and it is removed when the user submits the form or closes the tab. Users can opt out of the prefilling by clicking the "Cancel" button in the notification.
15+
The temporary form data is saved on change, and it is removed when the user submits the form or closes the tab. Users can opt out of the prefilling by clicking the "Cancel" button in the notification.
1616

17-
Saved data is not sent to the server. It is only persisted using the [store](./Store.md) and is removed when the user logs out.
17+
Saved data is not sent to the server. It is only persisted using the [store](./Store.md) and is removed when the user logs out.
1818

1919
## Usage
2020

@@ -35,15 +35,15 @@ const PostEdit = () => (
3535
);
3636
```
3737

38-
The component will automatically save the form data in the store on unmount and reapply it when the form is mounted again.
38+
The component will automatically save the form data in the store on change and reapply it when the form is mounted again.
3939

4040
It works both on create and edit forms.
4141

4242
## Props
4343

44-
| Prop | Required | Type | Default | Description |
45-
| --------------------- | -------- | ---------- | -------------------------------------------------------- | ------------------------------------------------------------- |
46-
| `getStoreKey` | - | `function` | - | Function to use your own store key. |
44+
| Prop | Required | Type | Default | Description |
45+
| --------------------- | -------- | ---------- | -------------------------------------------------------- | --------------------------------------------------------------------- |
46+
| `getStoreKey` | - | `function` | - | Function to use your own store key. |
4747
| `notificationMessage` | - | `string` | "Applied previous unsaved changes" | Notification message to inform users that their previously saved changes have been applied. |
4848

4949
## `getStoreKey`
@@ -68,10 +68,9 @@ You can override this key by passing a custom function as the `getStoreKey` prop
6868
/>
6969
```
7070

71-
7271
## `notificationMessage`
7372

74-
When `<AutoPersistInStore>` component applies the changes from the store to a form, react-admin informs users with a notification.
73+
When `<AutoPersistInStore>` component applies the changes from the store to a form, react-admin informs users with a notification.
7574

7675
The default notification message is `ra-form-layout.auto_persist_in_store.applied_changes`, which is translated using the i18n provider (the default English translation is `Applied previous unsaved changes`).
7776

0 commit comments

Comments
 (0)