Last active
August 14, 2019 14:24
-
-
Save Tevinthuku/8968ef4b6bdb23be9d8a3783c9405789 to your computer and use it in GitHub Desktop.
a call to scheduleUpdate from setState
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {scheduleUpdate} from "./reconciler" | |
export class Component { | |
constructor(props) { | |
this.props = props || {}; | |
this.state = this.state || {}; | |
} | |
setState(partialState) { | |
// we'll define this function in the reconciler.js file. | |
scheduleUpdate(this, partialState); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment