Skip to content

Commit a9ee623

Browse files
authored
Merge pull request #6238 from WiXSL/fix-jsdocs-hooks
[Doc] Fix useDelete and useUpdate JsDocs examples
2 parents e42e1e2 + 073aa4d commit a9ee623

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/ra-core/src/dataProvider/useDelete.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ import useMutation, { MutationOptions, Mutation } from './useMutation';
4545
* const DeleteButton = ({ record }) => {
4646
* const [deleteOne, { loading, error }] = useDelete('likes', record.id, record);
4747
* if (error) { return <p>ERROR</p>; }
48-
* return <button disabled={loading} onClick={deleteOne}>Delete</div>;
48+
* return <button disabled={loading} onClick={deleteOne}>Delete</button>;
4949
* };
5050
*/
5151
const useDelete = <RecordType extends Record = Record>(

packages/ra-core/src/dataProvider/useUpdate.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ import useMutation, { MutationOptions, Mutation } from './useMutation';
4747
* const diff = { likes: record.likes + 1 };
4848
* const [update, { loading, error }] = useUpdate('likes', record.id, diff, record);
4949
* if (error) { return <p>ERROR</p>; }
50-
* return <button disabled={loading} onClick={update}>Like</div>;
50+
* return <button disabled={loading} onClick={update}>Like</button>;
5151
* };
5252
*
5353
* @example // TypeScript

0 commit comments

Comments
 (0)