2018-10-12 15:37:13 -04:00
|
|
|
---
|
|
|
|
title: Create a Stateless Functional Component
|
|
|
|
---
|
2019-07-24 00:59:27 -07:00
|
|
|
# Create a Stateless Functional Component
|
|
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
## Hints
|
2018-10-12 15:37:13 -04:00
|
|
|
|
|
|
|
### Hint 1
|
|
|
|
|
|
|
|
- Stateless functions are one of the ways to create a React component.
|
2019-04-20 11:55:03 -04:00
|
|
|
- These functions can receive data and render it, but do not manage or track changes to that data.
|
|
|
|
- To make the component, a stateless component, a return function is one of the necessary things and that's what is missing
|
2018-10-12 15:37:13 -04:00
|
|
|
|
|
|
|
### Hint 2
|
|
|
|
|
|
|
|
A return function is added like this
|
2019-07-24 00:59:27 -07:00
|
|
|
```jsx
|
2018-10-12 15:37:13 -04:00
|
|
|
return(
|
|
|
|
<return elements>
|
|
|
|
);
|
2019-07-24 00:59:27 -07:00
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
## Solutions
|
2018-10-12 15:37:13 -04:00
|
|
|
|
2019-07-24 00:59:27 -07:00
|
|
|
<details><summary>Solution 1 (Click to Show/Hide)</summary>
|
2018-10-12 15:37:13 -04:00
|
|
|
|
2019-07-24 00:59:27 -07:00
|
|
|
```jsx
|
2018-10-12 15:37:13 -04:00
|
|
|
return(
|
|
|
|
<div>Completed challenge!</div>
|
|
|
|
);
|
2019-07-24 00:59:27 -07:00
|
|
|
```
|
|
|
|
</details>
|