--- title: Tabs tags: components,state,children,intermediate --- Renders a tabbed menu and view component. - Define a `Tabs` component that uses the `useState()` hook to initialize the value of the `bindIndex` state variable to `defaultIndex`. - Define a `TabItem` component and filter `children` passed to the `Tabs` component to remove unnecessary nodes except for `TabItem` by identifying the function's name. - Define `changeTab`, which will be executed when clicking a ` ))}
{items.map(({ props }) => (
))}
); }; ``` ```jsx ReactDOM.render( Lorem ipsum Dolor sit amet , document.getElementById('root') ); ```