MCPcopy
hub / github.com/facebook/react / enqueueSetState

Function enqueueSetState

packages/react-server/src/ReactFizzClassComponent.js:112–124  ·  view source on GitHub ↗
(inst: any, payload: any, callback)

Source from the content-addressed store, hash-verified

110const classComponentUpdater = {
111 // $FlowFixMe[missing-local-annot]
112 enqueueSetState(inst: any, payload: any, callback) {
113 const internals: InternalInstance = getInstance(inst);
114 if (internals.queue === null) {
115 warnNoop(inst, 'setState');
116 } else {
117 internals.queue.push(payload);
118 if (__DEV__) {
119 if (callback !== undefined && callback !== null) {
120 warnOnInvalidCallback(callback);
121 }
122 }
123 }
124 },
125 enqueueReplaceState(inst: any, payload: any, callback: null) {
126 const internals: InternalInstance = getInstance(inst);
127 internals.replace = true;

Callers

nothing calls this directly

Calls 4

getInstanceFunction · 0.85
warnNoopFunction · 0.70
warnOnInvalidCallbackFunction · 0.70
pushMethod · 0.65

Tested by

no test coverage detected