import React from "react"; import PropTypes from "prop-types"; const Header = ({ title }) => { return ( <header className="header"> <h1>{title}</h1> </header> ); }; Header.propTypes = { title: PropTypes.string.isRequired, }; export default Header; ///// ----- USING IT ------- import Header from "./components/Header"; <Header title="New Pixar Movies" />
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