Skip to content

Instantly share code, notes, and snippets.

@Tevinthuku
Last active August 14, 2019 14:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Tevinthuku/8968ef4b6bdb23be9d8a3783c9405789 to your computer and use it in GitHub Desktop.
Save Tevinthuku/8968ef4b6bdb23be9d8a3783c9405789 to your computer and use it in GitHub Desktop.
a call to scheduleUpdate from setState
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