function formatDate(date) { return date.toLocaleDateString(); } function Avatar(props) { return ( {props.user.name} ); } function UserInfo(props) { return (
{props.user.name}
); } function Comment(props) { return (
{props.text}
{formatDate(props.date)}
); } const comment = { date: new Date(), text: 'I hope you enjoy learning React!', author: { name: 'Hello Kitty', avatarUrl: 'https://placekitten.com/g/64/64', }, }; ReactDOM.render( , document.getElementById('root') );