MCPcopy Create free account
hub / github.com/QuarkGluonPlasma/react-course-code / setState

Function setState

mini-react/src/mini-react.js:226–236  ·  view source on GitHub ↗
(action)

Source from the content-addressed store, hash-verified

224 wipFiber.stateHooks.push(stateHook);
225
226 function setState(action) {
227 const isFunction = typeof action === "function";
228
229 stateHook.queue.push(isFunction ? action : () => action);
230
231 wipRoot = {
232 ...currentFiber,
233 alternate: currentFiber,
234 };
235 nextUnitOfWork = wipRoot;
236 }
237
238 return [stateHook.state, setState];
239 }

Callers 4

useSizeFunction · 0.50
App4.tsxFile · 0.50
onMouseEnterFunction · 0.50
onMouseLeaveFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected