--- title: Collapse tags: components,children,state,beginner --- Renders a component with collapsible content. - Use the `useState()` hook to create the `isCollapsed` state variable with an initial value of `collapsed`. - Use the `
{children}
); }; ``` ```jsx ReactDOM.render(

This is a collapse

Hello world!

, document.getElementById('root') ); ```