Hello,
I have some problems to launch automaticaly the execice in codepen with this site:
Is it same for you?
Hello,
I have some problems to launch automaticaly the execice in codepen with this site:
Is it same for you?
Hello @karlito,
What do you mean exactly? Are you talking about the image below?
When I click the link it opens CodePen. But I am not sure if you are talking about this.
yes but for me nothing happens
Don’t know, maybe change of browser.
I can give you the code for now:
HTML
<div id="root">
<!-- This element's contents will be replaced with your component. -->
</div>
JS (Babel)
function formatDate(date) {
return date.toLocaleDateString();
}
function Comment(props) {
return (
<div className="Comment">
<div className="UserInfo">
<img className="Avatar"
src={props.author.avatarUrl}
alt={props.author.name} />
<div className="UserInfo-name">
{props.author.name}
</div>
</div>
<div className="Comment-text">
{props.text}
</div>
<div className="Comment-date">
{formatDate(props.date)}
</div>
</div>
);
}
const comment = {
date: new Date(),
text: 'I hope you enjoy learning React!',
author: {
name: 'Hello Kitty',
avatarUrl: 'http://placekitten.com/g/64/64'
}
};
ReactDOM.render(
<Comment
date={comment.date}
text={comment.text}
author={comment.author} />,
document.getElementById('root')
);
I just copied/paste
oups! that’s work now. I don’t understand.
thanks anyway
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.