cleanChildren

cleanChildren is a utility to get a list of all valid React child elements.

Import#

import { cleanChildren } from '@dwarvesf/react-utils'

Return value#

The cleanChildren hook returns a list of all valid React child elements.

Usage#

function Example() {
function App({ children }) {
return <div>{cleanChildren(children)}</div>
}
return (
<App>
abc
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
9999
</App>
)
}
Edit this page

Made with ❤️ by Dwarves Foundation