MCPcopy Create free account
hub / github.com/react/react / overrideContext

Function overrideContext

packages/react-devtools-shared/src/__tests__/editing-test.js:941–956  ·  view source on GitHub ↗
(path, value)

Source from the content-addressed store, hash-verified

939 await mountTestApp();
940
941 function overrideContext(path, value) {
942 const rendererID = utils.getRendererID();
943
944 // To simplify hydration and display of primitive context values (e.g. number, string)
945 // the inspectElement() method wraps context in a {value: ...} object.
946 path = ['value', ...path];
947
948 bridge.send('overrideValueAtPath', {
949 id,
950 path,
951 rendererID,
952 type: 'context',
953 value,
954 });
955 flushPendingUpdates();
956 }
957
958 overrideContext(['shallow'], 'updated');
959 expect(committedContext).toStrictEqual({

Callers 1

mountTestAppFunction · 0.70

Calls 1

flushPendingUpdatesFunction · 0.70

Tested by

no test coverage detected