function formatDate(date) {
return date.toLocaleDateString();
}
function Avatar(props) {
return (
);
}
function UserInfo(props) {
return (
);
}
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')
);