Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialTh T
376 PointsHello, I get stuck in this question?
Complete the code to display the value of a prop named time.
class Clock extends React.Component {
render() {
return (
<span className="time"> {props.time}</span> // what's the value of time?
);
}
}
5 Answers
Adam Beer
11,314 PointsWe don't know, but we saved the time value in the other file inside the state :) So now you can import the time from the other file.
Ana Sequeira
877 PointsThe correct answer is {this.props.time}
Amber Taranto
1,094 PointsThank you!
Th T
376 Pointsthanks guys for helping
Otto linden
5,857 PointsWhy is it props?
Adam Beer
11,314 PointsProps keyword tell the compiler how the information come from another file.
James Nguyen
Courses Plus Student 6,841 PointsI user this.props.time but it not working????
Henry Blandon
Full Stack JavaScript Techdegree Graduate 21,521 PointsMay be you are missing the curly braces {} {this.props.time}
Adam Beer
11,314 PointsAdam Beer
11,314 PointsYou are very close, just use the special keyword.
Anatolii Ryzhkov
7,573 PointsAnatolii Ryzhkov
7,573 PointsUnfortunately, I still don't understand what the answer should be :(