Setting default state
Set the default state in the constructor(). And without constructor using Babel with proposal-class-fields. See: Setting the default state
React is a JavaScript library for building user interfaces. This guide targets React v15 to v16.
Set the default state in the constructor(). And without constructor using Babel with proposal-class-fields. See: Setting the default state
As of React v16.2.0, fragments can be used to return multiple children without adding extra wrapping nodes to the DOM.
Use states (this.state) to manage dynamic data. With Babel you can use proposal-class-fields and get rid of constructor See: States