Skip to content

Commit 67c4875

Browse files
Kawsar Ahmedcamperbot
authored andcommitted
React: Render State in the User Interface (freeCodeCamp#10096)
1 parent 5240d92 commit 67c4875

File tree

1 file changed

+24
-3
lines changed
  • src/pages/certifications/front-end-libraries/react/render-state-in-the-user-interface

1 file changed

+24
-3
lines changed

src/pages/certifications/front-end-libraries/react/render-state-in-the-user-interface/index.md

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,30 @@
22
title: Render State in the User Interface
33
---
44
## Render State in the User Interface
5+
In the challenge, you will need to render a state value in `<h1>` tag, pretty simple.
56

6-
This is a stub. <a href='https://github.com/freecodecamp/guides/tree/master/src/pages/certifications/front-end-libraries/react/render-state-in-the-user-interface/index.md' target='_blank' rel='nofollow'>Help our community expand it</a>.
7+
## Hint
8+
Just make a `<h1>` tag and render `this.state.name` between tag.
79

8-
<a href='https://github.com/freecodecamp/guides/blob/master/README.md' target='_blank' rel='nofollow'>This quick style guide will help ensure your pull request gets accepted</a>.
910

10-
<!-- The article goes here, in GitHub-flavored Markdown. Feel free to add YouTube videos, images, and CodePen/JSBin embeds -->
11+
## Solution
12+
13+
```react.js
14+
class MyComponent extends React.Component {
15+
constructor(props) {
16+
super(props);
17+
this.state = {
18+
name: 'freeCodeCamp'
19+
}
20+
}
21+
render() {
22+
return (
23+
<div>
24+
{ /* change code below this line */ }
25+
<h1>{this.state.name}</h1>
26+
{ /* change code above this line */ }
27+
</div>
28+
);
29+
}
30+
};
31+
```

0 commit comments

Comments
 (0)