2018-10-12 15:37:13 -04:00
|
|
|
---
|
|
|
|
title: Getting Started with React Redux
|
|
|
|
---
|
2019-07-24 00:59:27 -07:00
|
|
|
# Getting Started with React Redux
|
|
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
## Hints
|
2018-10-12 15:37:13 -04:00
|
|
|
|
2019-05-09 06:27:06 -07:00
|
|
|
### Hint 1
|
|
|
|
Remember to pass parameter props to constructor
|
2018-10-12 15:37:13 -04:00
|
|
|
|
2019-05-09 06:27:06 -07:00
|
|
|
### Hint 2
|
|
|
|
Remember the super(props) in constructor
|
2018-10-12 15:37:13 -04:00
|
|
|
|
2019-07-24 00:59:27 -07:00
|
|
|
|
|
|
|
---
|
|
|
|
## Solutions
|
|
|
|
|
|
|
|
<details><summary>Solution 1 (Click to Show/Hide)</summary>
|
2019-05-09 06:27:06 -07:00
|
|
|
|
|
|
|
```jsx
|
|
|
|
class DisplayMessages extends React.Component {
|
|
|
|
// change code below this line
|
|
|
|
constructor(props){
|
|
|
|
super(props);
|
|
|
|
this.state={
|
|
|
|
input:'',
|
|
|
|
messages:[]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// change code above this line
|
|
|
|
render() {
|
|
|
|
return <div />
|
|
|
|
}
|
|
|
|
};
|
|
|
|
```
|
|
|
|
</details>
|