[Beta] Note on Children vs children

This commit is contained in:
Dan Abramov
2022-10-19 15:59:12 +01:00
parent 7e98d1f6f9
commit d0a809a44c

View File

@@ -365,6 +365,18 @@ As mentioned earlier, there is no way to get the rendered output of an inner com
## Alternatives {/*alternatives*/}
<Note>
This section describes alternatives to the `Children` API (with capital `C`) that's imported like this:
```js
import { Children } from 'react';
```
Don't confuse it with [using the `children` prop](/learn/passing-props-to-a-component#passing-jsx-as-children) (lowercase `c`), which is good and encouraged.
</Note>
### Exposing multiple components {/*exposing-multiple-components*/}
Manipulating children with the `Children` methods often leads to fragile code. When you pass children to a component in JSX, you don't usually expect the component to manipulate or transform the individual children.