diff --git a/docs/Inputs.md b/docs/Inputs.md index 9b3f3b3ca71..451910f7929 100644 --- a/docs/Inputs.md +++ b/docs/Inputs.md @@ -542,6 +542,8 @@ const PostEdit = () => ( ); ``` +**Tip:** TypeScript users will notice that `scopedFormData` and `getSource` are typed as optional parameters. This is because the `` component can be used outside of an `` and in that case, these parameters will be `undefined`. If you are inside an ``, you can safely assume that these parameters will be defined. + ## Hiding Inputs Based On Other Inputs You may want to display or hide inputs based on the value of another input - for instance, show an `email` input only if the `hasEmail` boolean input has been ticked to `true`. diff --git a/docs/SimpleFormIterator.md b/docs/SimpleFormIterator.md index 7a5c1234c5c..bfdba0ecd07 100644 --- a/docs/SimpleFormIterator.md +++ b/docs/SimpleFormIterator.md @@ -153,6 +153,8 @@ const PostEdit = () => ( ); ``` +**Tip:** TypeScript users will notice that `scopedFormData` and `getSource` are typed as optional parameters. This is because the `` component can be used outside of a `` and in that case, these parameters will be `undefined`. If you are inside a ``, you can safely assume that these parameters will be defined. + **Note**: `` only accepts `Input` components as children. If you want to use some `Fields` instead, you have to use a ``, as follows: ```jsx