--- title: Collapsible content tags: components,children,state expertise: beginner firstSeen: 2018-10-17T20:42:23+03:00 lastUpdated: 2021-10-13T19:29:39+02:00 --- Renders a component with collapsible content. - Use the `useState()` hook to create the `isCollapsed` state variable. Give it an initial value of `collapsed`. - Use the `
{children}
); }; ``` ```jsx ReactDOM.render(

This is a collapse

Hello world!

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