Webcitagram

How do you add local state to a class? — 1. in render(), replace this.props.yourProp with: this.state.yourProp 2. add a class Constructor and initialize this state in it, such as: constructor(props){ super(props); this.state = {yourProp: "whatever"}; } 3. remove the prop from the element:

picture loading error handler
28 thought(s)28

React & Redux

For webdevelopers: learning to use React and Redux

Explore more quotes

Aurélie Bayre