MCPcopy Create free account
hub / github.com/microsoft/SandDance / warnInvalidContextAccess

Function warnInvalidContextAccess

docs/external/js/react-dom.development.js:15824–15826  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

15822
15823 {
15824 var warnInvalidContextAccess = function () {
15825 error('Context can only be read while React is rendering. ' + 'In classes, you can read it in the render method or getDerivedStateFromProps. ' + 'In function components, you can read it directly in the function body, but not ' + 'inside Hooks like useReducer() or useMemo().');
15826 };
15827
15828 var warnInvalidHookAccess = function () {
15829 error('Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. ' + 'You can only call Hooks at the top level of your React function. ' + 'For more information, see ' + 'https://fb.me/rules-of-hooks');

Callers 1

Calls 1

errorFunction · 0.70

Tested by

no test coverage detected