Skip to content

Commit ff450ad

Browse files
committed
Fix typos
1 parent 12fe1a6 commit ff450ad

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/Inputs.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ form state value --> format --> form input value (string)
142142

143143
`format` often comes in pair with [`parse`](#parse) to transform the input value before storing it in the form state. See the [Transforming Input Value](#transforming-input-value-tofrom-record) section for more details.
144144

145-
**Tip:** By default, react-admin inputs have to following `format` function, which turns any `null` or `undefined` value into an empty string. This is to avoid warnings about controlled/uncontrolled input components:
145+
**Tip:** By default, react-admin inputs have the following `format` function, which turns any `null` or `undefined` value into an empty string. This is to avoid warnings about controlled/uncontrolled input components:
146146

147147
```js
148148
const defaultFormat = (value: any) => value == null ? '' : value;
@@ -221,7 +221,7 @@ form input value (string) ---> parse ---> form state value
221221

222222
`parse` often comes in pair with [`format`](#format) to transform the form value before passing it to the input. See the [Transforming Input Value](#transforming-input-value-tofrom-record) section for more details.
223223

224-
**Tip:** By default, react-admin inputs have to following `parse` function, which transforms any empty string into `null`:
224+
**Tip:** By default, react-admin inputs have the following `parse` function, which transforms any empty string into `null`:
225225

226226
```js
227227
const defaultParse = (value: string) => value === '' ? null : value;
@@ -388,7 +388,7 @@ const dateParser = value => {
388388
<DateInput source="isodate" format={dateFormatter} parse={dateParser} defaultValue={new Date()} />
389389
```
390390

391-
**Tip:** A common usage for this feature is to deal with empty values. Indeed HTML form inputs always return strings, even for numbers and booleans, however most backends expect a value like `null`. This is why, by default, all react-admin inputs will store the value `null` when the HTML input value is `''`.
391+
**Tip:** A common usage for this feature is to deal with empty values. Indeed, HTML form inputs always return strings, even for numbers and booleans, however most backends expect a value like `null`. This is why, by default, all react-admin inputs will store the value `null` when the HTML input value is `''`.
392392

393393
**Tip**: If you need to do this globally, including for custom input components that do not use [the `useInput` hook](#the-useinput-hook), have a look at [the `sanitizeEmptyValues` prop of the `<Form>` component](./Form.md#sanitizeemptyvalues).
394394

0 commit comments

Comments
 (0)