--- title: Collapsible content tags: components,children,state cover: washed-ashore 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.createRoot(document.getElementById('root')).render(

This is a collapse

Hello world!

); ```