Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Doc] Update migration guide with useRecordSelection changes #10244

Merged
merged 2 commits into from
Sep 30, 2024
Merged
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
15 changes: 15 additions & 0 deletions docs/Upgrade.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ React-admin v5 mostly focuses on removing deprecated features and upgrading depe
- [Updates to bulkActionButtons Syntax](#updates-to-bulkactionbuttons-syntax)
- [`<PaginationLimit>` Component Was Removed](#paginationlimit-component-was-removed)
- [`<DatagridBody>` No Longer Provides record Prop To `<DatagridRow>`](#datagridbody-no-longer-provides-record-prop-to-datagridrow)
- [`useRecordSelection` Props have changed](#userecordselection-props-have-changed)
- [Show and Edit Pages](#show-and-edit-pages)
- [Custom Edit or Show Actions No Longer Receive Any Props](#custom-edit-or-show-actions-no-longer-receive-any-props)
- [Inputs default ids are auto-generated](#inputs-default-ids-are-auto-generated)
Expand Down Expand Up @@ -923,6 +924,20 @@ const MyDatagridRow = ({

See the [`<Datagrid body/>`](./Datagrid.md#body) documentation to learn how to create your own row component.

### `useRecordSelection` Props Have Changed

The props passed to the `useRecordSelection` hook have changed.
You have to pass an object with a `resource` attribute instead of a string.

```diff
const MyComponent = () => {
- const [selectedIds, selectionModifiers] = useRecordSelection('posts');
+ const [selectedIds, selectionModifiers] = useRecordSelection( { resource: 'posts' });

...
};
```

## Show and Edit Pages

### Custom Edit or Show Actions No Longer Receive Any Props
Expand Down
Loading