2018-10-12 15:37:13 -04:00
|
|
|
---
|
|
|
|
title: Getting Started with React Redux
|
|
|
|
---
|
|
|
|
## Getting Started with React Redux
|
|
|
|
|
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-05-09 06:27:06 -07:00
|
|
|
### Solution
|
|
|
|
<details>
|
|
|
|
<summary>Spoiler!</summary>
|
|
|
|
|
|
|
|
```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>
|