(props)
| 12 | } |
| 13 | |
| 14 | constructor(props) |
| 15 | { |
| 16 | super(props); |
| 17 | console.log("I am the constructor from news component"); |
| 18 | this.state={ |
| 19 | articles: [], |
| 20 | loading:false, //It is used to add spinner when the webpage is buffering |
| 21 | page: 1 |
| 22 | } |
| 23 | var text=this.props.category; |
| 24 | var a=text.toUpperCase(); |
| 25 | document.title= `${a}- NewsMonkey`; |
| 26 | } |
| 27 | |
| 28 | //componentDidMount always runs after render method |
| 29 | async componentDidMount(){ |