A simple 'Hello World' component in React.
import React from 'react'; const HelloWorld = () => { return ( <div> <h1>Hello, World!</h1> </div> ); }; export default HelloWorld;
This code defines a functional React component called HelloWorld. It returns a JSX element containing a div with an h1 element that displays 'Hello, World!'.