function Car(props) { return <h2>I am a { props.brand }!</h2>; } function Garage() { return ( <> <h1>Who lives in my garage?</h1> <Car brand="Ford" /> </> ); } const root = ReactDOM.createRoot(document.getElementById('root')); root.render(<Garage />);
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter