When you use setState()
, then, apart from assigning to the state object, React also re-renders the component and all of its children. You will get an error similar to this: only a mounted or mounting component can be updated. So we need to use this.state
to initialise variables inside the constructor.
Lectures and tutorial on "Scripting client side JavaScript, jqvery, BackBone"
Comments