--- title: Collapse tags: visual,children,state,intermediate --- Renders a component with collapsible content. - Use the `React.setState()` hook to create the `isCollapsed` state variable with an initial value of `props.collapsed`. - Use an object, `style`, to hold the styles for individual components and their states. - Use a `
` to wrap both the `
{props.children}
); } ``` ```jsx ReactDOM.render(

This is a collapse

Hello world!

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