Skip to content

Commit 2fa6a34

Browse files
committed
chore(docs): update renderer children documentation
1 parent 7c7a7cb commit 2fa6a34

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

packages/react-renderer-demo/src/pages/components/children.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,23 @@ import DocPage from '@docs/doc-page';
88

99
## Props
1010

11+
Children are supplied with `formFields` and `schema` props. If a child has one of `schema` or `formFields` prop explicitly set, the explicit props will be used.
12+
13+
```jsx
14+
15+
/**
16+
* The ChildComponent will receive schema and formFields props from the FormRenderer.
17+
*/
18+
<FormRenderer {...props}><ChildComponent/></FormRenderer>
19+
20+
21+
/**
22+
* The ChildComponent will not receive schema prop from the FormRenderer! The schema prop will be equal to "Foo".
23+
* It will still receive the formFields prop from the renderer.
24+
*/
25+
<FormRenderer {...props}><ChildComponent schema="Foo"/></FormRenderer>
26+
```
27+
1128
### formFields
1229

1330
*node*

packages/react-renderer-demo/src/pages/hooks/use-form-api.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ This hook returns object containing following information:
2626

2727
If you want to render fields from a component (`tabs`, `subform`, etc.) you can use `renderForm(fields)` function.
2828

29+
## schema
30+
31+
*object*
32+
33+
The [schema prop](/components/renderer#schema) of FormRenderer.
34+
2935
## getState
3036

3137
*() => FormState*

0 commit comments

Comments
 (0)