> React hook for getting the type of any nested child component
npm install use-childuse-child> React hook for getting the type of any nested child component
``sh`
npm install use-child
`js
import useChild from 'use-child';
const Car = props => {
const [wheelExists, WheelComponent] = useChild(props.children, Wheel);
const [engineExists, EngineComponent] = useChild(props.children, Engine);
return (
const Wheel = () => {
return
const Engine = () => {
return