From 66ae41ac15a27703b7473ef96a96500f794a134c Mon Sep 17 00:00:00 2001 From: Francois Zaninotto Date: Fri, 30 Aug 2024 17:38:25 +0200 Subject: [PATCH] Fix typos --- docs/SimpleFormIterator.md | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/docs/SimpleFormIterator.md b/docs/SimpleFormIterator.md index c0b98c869c6..ad382ff3863 100644 --- a/docs/SimpleFormIterator.md +++ b/docs/SimpleFormIterator.md @@ -103,7 +103,7 @@ This prop lets you pass a custom element to replace the default Add button. You need to provide an element that triggers the `add` function from `useSimpleFormIterator` when clicked. Here is an example: ```jsx -import {ButtonProps, useSimpleFormIterator, useTranslate} from "react-admin"; +import { ButtonProps, useSimpleFormIterator, useTranslate } from "react-admin"; import React from "react"; import Button from "@mui/material/Button"; @@ -112,11 +112,7 @@ export const MyAddButton = (props: ButtonProps) => { const translate = useTranslate(); return ( - ); @@ -329,33 +325,25 @@ You need to provide an element that triggers the `remove` function from `useSimp ```jsx import * as React from 'react'; import clsx from 'clsx'; -import {ButtonProps, useSimpleFormIterator, useSimpleFormIteratorItem, useTranslate} from "react-admin"; +import { ButtonProps, useSimpleFormIteratorItem, useTranslate } from "react-admin"; import Button from "@mui/material/Button"; export const MyRemoveButton = (props: Omit) => { - const { remove, index } = useSimpleFormIteratorItem(); - const { source } = useSimpleFormIterator(); - const { className, ...rest } = props; + const { remove } = useSimpleFormIteratorItem(); const translate = useTranslate(); return ( ); }; ``` + ## `reOrderButtons` This prop lets you pass a custom element to replace the default Up and Down buttons. This custom element must use the `useSimpleFormIteratorItem` hook to access the current row index and reorder callback.