code stringlengths 24 2.07M | docstring stringlengths 25 85.3k | func_name stringlengths 1 92 | language stringclasses 1
value | repo stringlengths 5 64 | path stringlengths 4 172 | url stringlengths 44 218 | license stringclasses 7
values |
|---|---|---|---|---|---|---|---|
function updateWorkInProgressHook() {
// This function is used both for updates and for re-renders triggered by a
// render phase update. It assumes there is either a current hook we can
// clone, or a work-in-progress hook from a previous render pass that we can
// use as a base. When we reach the end ... | Warns if there is a duplicate or missing key | updateWorkInProgressHook | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function createFunctionComponentUpdateQueue() {
return {
lastEffect: null,
stores: null
};
} | Warns if there is a duplicate or missing key | createFunctionComponentUpdateQueue | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function basicStateReducer(state, action) {
// $FlowFixMe: Flow doesn't like mixed types
return typeof action === 'function' ? action(state) : action;
} | Warns if there is a duplicate or missing key | basicStateReducer | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function mountReducer(reducer, initialArg, init) {
var hook = mountWorkInProgressHook();
var initialState;
if (init !== undefined) {
initialState = init(initialArg);
} else {
initialState = initialArg;
}
hook.memoizedState = hook.baseState = initialState;
var queue = {
pe... | Warns if there is a duplicate or missing key | mountReducer | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function updateReducer(reducer, initialArg, init) {
var hook = updateWorkInProgressHook();
var queue = hook.queue;
if (queue === null) {
throw new Error('Should have a queue. This is likely a bug in React. Please file an issue.');
}
queue.lastRenderedReducer = reducer;
var current = curr... | Warns if there is a duplicate or missing key | updateReducer | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function rerenderReducer(reducer, initialArg, init) {
var hook = updateWorkInProgressHook();
var queue = hook.queue;
if (queue === null) {
throw new Error('Should have a queue. This is likely a bug in React. Please file an issue.');
}
queue.lastRenderedReducer = reducer; // This is a re-rend... | Warns if there is a duplicate or missing key | rerenderReducer | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function mountMutableSource(source, getSnapshot, subscribe) {
{
return undefined;
}
} | Warns if there is a duplicate or missing key | mountMutableSource | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function updateMutableSource(source, getSnapshot, subscribe) {
{
return undefined;
}
} | Warns if there is a duplicate or missing key | updateMutableSource | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function mountSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {
var fiber = currentlyRenderingFiber$1;
var hook = mountWorkInProgressHook();
var nextSnapshot;
var isHydrating = getIsHydrating();
if (isHydrating) {
if (getServerSnapshot === undefined) {
throw new Error('Mi... | Warns if there is a duplicate or missing key | mountSyncExternalStore | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function updateSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {
var fiber = currentlyRenderingFiber$1;
var hook = updateWorkInProgressHook(); // Read the current snapshot from the store on every render. This breaks the
// normal rules of React, and only works because store updates are
// a... | Warns if there is a duplicate or missing key | updateSyncExternalStore | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function pushStoreConsistencyCheck(fiber, getSnapshot, renderedSnapshot) {
fiber.flags |= StoreConsistency;
var check = {
getSnapshot: getSnapshot,
value: renderedSnapshot
};
var componentUpdateQueue = currentlyRenderingFiber$1.updateQueue;
if (componentUpdateQueue === null) {
com... | Warns if there is a duplicate or missing key | pushStoreConsistencyCheck | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function updateStoreInstance(fiber, inst, nextSnapshot, getSnapshot) {
// These are updated in the passive phase
inst.value = nextSnapshot;
inst.getSnapshot = getSnapshot; // Something may have been mutated in between render and commit. This could
// have been in an event that fired before the passive e... | Warns if there is a duplicate or missing key | updateStoreInstance | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function subscribeToStore(fiber, inst, subscribe) {
var handleStoreChange = function () {
// The store changed. Check if the snapshot changed since the last time we
// read from the store.
if (checkIfSnapshotChanged(inst)) {
// Force a re-render.
forceStoreRerender(fiber);
}
... | Warns if there is a duplicate or missing key | subscribeToStore | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
handleStoreChange = function () {
// The store changed. Check if the snapshot changed since the last time we
// read from the store.
if (checkIfSnapshotChanged(inst)) {
// Force a re-render.
forceStoreRerender(fiber);
}
} | Warns if there is a duplicate or missing key | handleStoreChange | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function checkIfSnapshotChanged(inst) {
var latestGetSnapshot = inst.getSnapshot;
var prevValue = inst.value;
try {
var nextValue = latestGetSnapshot();
return !objectIs(prevValue, nextValue);
} catch (error) {
return true;
}
} | Warns if there is a duplicate or missing key | checkIfSnapshotChanged | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function forceStoreRerender(fiber) {
var root = enqueueConcurrentRenderForLane(fiber, SyncLane);
if (root !== null) {
scheduleUpdateOnFiber(root, fiber, SyncLane, NoTimestamp);
}
} | Warns if there is a duplicate or missing key | forceStoreRerender | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function mountState(initialState) {
var hook = mountWorkInProgressHook();
if (typeof initialState === 'function') {
// $FlowFixMe: Flow doesn't like mixed types
initialState = initialState();
}
hook.memoizedState = hook.baseState = initialState;
var queue = {
pending: null,
... | Warns if there is a duplicate or missing key | mountState | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function updateState(initialState) {
return updateReducer(basicStateReducer);
} | Warns if there is a duplicate or missing key | updateState | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function rerenderState(initialState) {
return rerenderReducer(basicStateReducer);
} | Warns if there is a duplicate or missing key | rerenderState | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function pushEffect(tag, create, destroy, deps) {
var effect = {
tag: tag,
create: create,
destroy: destroy,
deps: deps,
// Circular
next: null
};
var componentUpdateQueue = currentlyRenderingFiber$1.updateQueue;
if (componentUpdateQueue === null) {
componentUp... | Warns if there is a duplicate or missing key | pushEffect | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function mountRef(initialValue) {
var hook = mountWorkInProgressHook();
{
var _ref2 = {
current: initialValue
};
hook.memoizedState = _ref2;
return _ref2;
}
} | Warns if there is a duplicate or missing key | mountRef | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function updateRef(initialValue) {
var hook = updateWorkInProgressHook();
return hook.memoizedState;
} | Warns if there is a duplicate or missing key | updateRef | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function mountEffectImpl(fiberFlags, hookFlags, create, deps) {
var hook = mountWorkInProgressHook();
var nextDeps = deps === undefined ? null : deps;
currentlyRenderingFiber$1.flags |= fiberFlags;
hook.memoizedState = pushEffect(HasEffect | hookFlags, create, undefined, nextDeps);
} | Warns if there is a duplicate or missing key | mountEffectImpl | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function updateEffectImpl(fiberFlags, hookFlags, create, deps) {
var hook = updateWorkInProgressHook();
var nextDeps = deps === undefined ? null : deps;
var destroy = undefined;
if (currentHook !== null) {
var prevEffect = currentHook.memoizedState;
destroy = prevEffect.destroy;
if (... | Warns if there is a duplicate or missing key | updateEffectImpl | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function mountEffect(create, deps) {
if ( (currentlyRenderingFiber$1.mode & StrictEffectsMode) !== NoMode) {
return mountEffectImpl(MountPassiveDev | Passive | PassiveStatic, Passive$1, create, deps);
} else {
return mountEffectImpl(Passive | PassiveStatic, Passive$1, create, deps);
}
} | Warns if there is a duplicate or missing key | mountEffect | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function updateEffect(create, deps) {
return updateEffectImpl(Passive, Passive$1, create, deps);
} | Warns if there is a duplicate or missing key | updateEffect | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function mountInsertionEffect(create, deps) {
return mountEffectImpl(Update, Insertion, create, deps);
} | Warns if there is a duplicate or missing key | mountInsertionEffect | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function updateInsertionEffect(create, deps) {
return updateEffectImpl(Update, Insertion, create, deps);
} | Warns if there is a duplicate or missing key | updateInsertionEffect | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function mountLayoutEffect(create, deps) {
var fiberFlags = Update;
{
fiberFlags |= LayoutStatic;
}
if ( (currentlyRenderingFiber$1.mode & StrictEffectsMode) !== NoMode) {
fiberFlags |= MountLayoutDev;
}
return mountEffectImpl(fiberFlags, Layout, create, deps);
} | Warns if there is a duplicate or missing key | mountLayoutEffect | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function updateLayoutEffect(create, deps) {
return updateEffectImpl(Update, Layout, create, deps);
} | Warns if there is a duplicate or missing key | updateLayoutEffect | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function imperativeHandleEffect(create, ref) {
if (typeof ref === 'function') {
var refCallback = ref;
var _inst = create();
refCallback(_inst);
return function () {
refCallback(null);
};
} else if (ref !== null && ref !== undefined) {
var refObject = ref;
{
... | Warns if there is a duplicate or missing key | imperativeHandleEffect | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function mountImperativeHandle(ref, create, deps) {
{
if (typeof create !== 'function') {
error('Expected useImperativeHandle() second argument to be a function ' + 'that creates a handle. Instead received: %s.', create !== null ? typeof create : 'null');
}
} // TODO: If deps are provided, s... | Warns if there is a duplicate or missing key | mountImperativeHandle | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function updateImperativeHandle(ref, create, deps) {
{
if (typeof create !== 'function') {
error('Expected useImperativeHandle() second argument to be a function ' + 'that creates a handle. Instead received: %s.', create !== null ? typeof create : 'null');
}
} // TODO: If deps are provided, ... | Warns if there is a duplicate or missing key | updateImperativeHandle | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function mountDebugValue(value, formatterFn) {// This hook is normally a no-op.
// The react-debug-hooks package injects its own implementation
// so that e.g. DevTools can display custom hook values.
} | Warns if there is a duplicate or missing key | mountDebugValue | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function mountCallback(callback, deps) {
var hook = mountWorkInProgressHook();
var nextDeps = deps === undefined ? null : deps;
hook.memoizedState = [callback, nextDeps];
return callback;
} | Warns if there is a duplicate or missing key | mountCallback | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function updateCallback(callback, deps) {
var hook = updateWorkInProgressHook();
var nextDeps = deps === undefined ? null : deps;
var prevState = hook.memoizedState;
if (prevState !== null) {
if (nextDeps !== null) {
var prevDeps = prevState[1];
if (areHookInputsEqual(nextDeps, p... | Warns if there is a duplicate or missing key | updateCallback | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function mountMemo(nextCreate, deps) {
var hook = mountWorkInProgressHook();
var nextDeps = deps === undefined ? null : deps;
var nextValue = nextCreate();
hook.memoizedState = [nextValue, nextDeps];
return nextValue;
} | Warns if there is a duplicate or missing key | mountMemo | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function updateMemo(nextCreate, deps) {
var hook = updateWorkInProgressHook();
var nextDeps = deps === undefined ? null : deps;
var prevState = hook.memoizedState;
if (prevState !== null) {
// Assume these are defined. If they're not, areHookInputsEqual will warn.
if (nextDeps !== null) {
... | Warns if there is a duplicate or missing key | updateMemo | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function mountDeferredValue(value) {
var hook = mountWorkInProgressHook();
hook.memoizedState = value;
return value;
} | Warns if there is a duplicate or missing key | mountDeferredValue | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function updateDeferredValue(value) {
var hook = updateWorkInProgressHook();
var resolvedCurrentHook = currentHook;
var prevValue = resolvedCurrentHook.memoizedState;
return updateDeferredValueImpl(hook, prevValue, value);
} | Warns if there is a duplicate or missing key | updateDeferredValue | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function rerenderDeferredValue(value) {
var hook = updateWorkInProgressHook();
if (currentHook === null) {
// This is a rerender during a mount.
hook.memoizedState = value;
return value;
} else {
// This is a rerender during an update.
var prevValue = currentHook.memoizedState... | Warns if there is a duplicate or missing key | rerenderDeferredValue | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function updateDeferredValueImpl(hook, prevValue, value) {
var shouldDeferValue = !includesOnlyNonUrgentLanes(renderLanes);
if (shouldDeferValue) {
// This is an urgent update. If the value has changed, keep using the
// previous value and spawn a deferred render to update it later.
if (!obje... | Warns if there is a duplicate or missing key | updateDeferredValueImpl | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function startTransition(setPending, callback, options) {
var previousPriority = getCurrentUpdatePriority();
setCurrentUpdatePriority(higherEventPriority(previousPriority, ContinuousEventPriority));
setPending(true);
var prevTransition = ReactCurrentBatchConfig$2.transition;
ReactCurrentBatchConfig$... | Warns if there is a duplicate or missing key | startTransition | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function mountTransition() {
var _mountState = mountState(false),
isPending = _mountState[0],
setPending = _mountState[1]; // The `start` method never changes.
var start = startTransition.bind(null, setPending);
var hook = mountWorkInProgressHook();
hook.memoizedState = start;
retu... | Warns if there is a duplicate or missing key | mountTransition | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function updateTransition() {
var _updateState = updateState(),
isPending = _updateState[0];
var hook = updateWorkInProgressHook();
var start = hook.memoizedState;
return [isPending, start];
} | Warns if there is a duplicate or missing key | updateTransition | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function rerenderTransition() {
var _rerenderState = rerenderState(),
isPending = _rerenderState[0];
var hook = updateWorkInProgressHook();
var start = hook.memoizedState;
return [isPending, start];
} | Warns if there is a duplicate or missing key | rerenderTransition | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function getIsUpdatingOpaqueValueInRenderPhaseInDEV() {
{
return isUpdatingOpaqueValueInRenderPhase;
}
} | Warns if there is a duplicate or missing key | getIsUpdatingOpaqueValueInRenderPhaseInDEV | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function mountId() {
var hook = mountWorkInProgressHook();
var root = getWorkInProgressRoot(); // TODO: In Fizz, id generation is specific to each server config. Maybe we
// should do this in Fiber, too? Deferring this decision for now because
// there's no other place to store the prefix except for an ... | Warns if there is a duplicate or missing key | mountId | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function updateId() {
var hook = updateWorkInProgressHook();
var id = hook.memoizedState;
return id;
} | Warns if there is a duplicate or missing key | updateId | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function dispatchReducerAction(fiber, queue, action) {
{
if (typeof arguments[3] === 'function') {
error("State updates from the useState() and useReducer() Hooks don't support the " + 'second callback argument. To execute a side effect after ' + 'rendering, declare it in the component body with useEf... | Warns if there is a duplicate or missing key | dispatchReducerAction | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function dispatchSetState(fiber, queue, action) {
{
if (typeof arguments[3] === 'function') {
error("State updates from the useState() and useReducer() Hooks don't support the " + 'second callback argument. To execute a side effect after ' + 'rendering, declare it in the component body with useEffect(... | Warns if there is a duplicate or missing key | dispatchSetState | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function isRenderPhaseUpdate(fiber) {
var alternate = fiber.alternate;
return fiber === currentlyRenderingFiber$1 || alternate !== null && alternate === currentlyRenderingFiber$1;
} | Warns if there is a duplicate or missing key | isRenderPhaseUpdate | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function enqueueRenderPhaseUpdate(queue, update) {
// This is a render phase update. Stash it in a lazily-created map of
// queue -> linked list of updates. After this render pass, we'll restart
// and apply the stashed updates on top of the work-in-progress hook.
didScheduleRenderPhaseUpdateDuringThisP... | Warns if there is a duplicate or missing key | enqueueRenderPhaseUpdate | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function entangleTransitionUpdate(root, queue, lane) {
if (isTransitionLane(lane)) {
var queueLanes = queue.lanes; // If any entangled lanes are no longer pending on the root, then they
// must have finished. We can remove them from the shared queue, which
// represents a superset of the actually ... | Warns if there is a duplicate or missing key | entangleTransitionUpdate | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function markUpdateInDevTools(fiber, lane, action) {
{
markStateUpdateScheduled(fiber, lane);
}
} | Warns if there is a duplicate or missing key | markUpdateInDevTools | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
warnInvalidContextAccess = function () {
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()... | Warns if there is a duplicate or missing key | warnInvalidContextAccess | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
warnInvalidHookAccess = function () {
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://reactjs.org/link/rules-of-hooks');
} | Warns if there is a duplicate or missing key | warnInvalidHookAccess | javascript | facebook/memlab | packages/lens/src/tests/lib/react-dom-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-dom-v18.dev.js | MIT |
function Component(props, context, updater) {
this.props = props;
this.context = context; // If a component has string refs, we will assign a different object later.
this.refs = emptyObject; // We initialize the default updater but the real one gets injected by the
// renderer.
this.updater = upda... | Base class helpers for the updating state of a component. | Component | javascript | facebook/memlab | packages/lens/src/tests/lib/react-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-v18.dev.js | MIT |
defineDeprecationWarning = function (methodName, info) {
Object.defineProperty(Component.prototype, methodName, {
get: function () {
warn('%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]);
return undefined;
}
});
} | Deprecated APIs. These APIs used to exist on classic React classes but since
we would like to deprecate them, we're not going to move them over to this
modern base class. Instead, we define a getter that warns if it's accessed. | defineDeprecationWarning | javascript | facebook/memlab | packages/lens/src/tests/lib/react-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-v18.dev.js | MIT |
function PureComponent(props, context, updater) {
this.props = props;
this.context = context; // If a component has string refs, we will assign a different object later.
this.refs = emptyObject;
this.updater = updater || ReactNoopUpdateQueue;
} | Convenience component with default shallow equality check for sCU. | PureComponent | javascript | facebook/memlab | packages/lens/src/tests/lib/react-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-v18.dev.js | MIT |
function createRef() {
var refObject = {
current: null
};
{
Object.seal(refObject);
}
return refObject;
} | Convenience component with default shallow equality check for sCU. | createRef | javascript | facebook/memlab | packages/lens/src/tests/lib/react-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-v18.dev.js | MIT |
function isArray(a) {
return isArrayImpl(a);
} | Convenience component with default shallow equality check for sCU. | isArray | javascript | facebook/memlab | packages/lens/src/tests/lib/react-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-v18.dev.js | MIT |
function typeName(value) {
{
// toStringTag is needed for namespaced types like Temporal.Instant
var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;
var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object';
return type;
}
} // $F... | Convenience component with default shallow equality check for sCU. | typeName | javascript | facebook/memlab | packages/lens/src/tests/lib/react-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-v18.dev.js | MIT |
function willCoercionThrow(value) {
{
try {
testStringCoercion(value);
return false;
} catch (e) {
return true;
}
}
} | Convenience component with default shallow equality check for sCU. | willCoercionThrow | javascript | facebook/memlab | packages/lens/src/tests/lib/react-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-v18.dev.js | MIT |
function testStringCoercion(value) {
// If you ended up here by following an exception call stack, here's what's
// happened: you supplied an object or symbol value to React (as a prop, key,
// DOM attribute, CSS property, string ref, etc.) and when React tried to
// coerce it to a string using `'' + va... | Convenience component with default shallow equality check for sCU. | testStringCoercion | javascript | facebook/memlab | packages/lens/src/tests/lib/react-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-v18.dev.js | MIT |
function checkKeyStringCoercion(value) {
{
if (willCoercionThrow(value)) {
error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value));
return testStringCoercion(value); // throw (to help callers find troublesh... | Convenience component with default shallow equality check for sCU. | checkKeyStringCoercion | javascript | facebook/memlab | packages/lens/src/tests/lib/react-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-v18.dev.js | MIT |
function getWrappedName(outerType, innerType, wrapperName) {
var displayName = outerType.displayName;
if (displayName) {
return displayName;
}
var functionName = innerType.displayName || innerType.name || '';
return functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName;
... | Convenience component with default shallow equality check for sCU. | getWrappedName | javascript | facebook/memlab | packages/lens/src/tests/lib/react-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-v18.dev.js | MIT |
function getContextName(type) {
return type.displayName || 'Context';
} // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead. | Convenience component with default shallow equality check for sCU. | getContextName | javascript | facebook/memlab | packages/lens/src/tests/lib/react-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-v18.dev.js | MIT |
function getComponentNameFromType(type) {
if (type == null) {
// Host root, text node or just invalid type.
return null;
}
{
if (typeof type.tag === 'number') {
error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an i... | Convenience component with default shallow equality check for sCU. | getComponentNameFromType | javascript | facebook/memlab | packages/lens/src/tests/lib/react-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-v18.dev.js | MIT |
function hasValidRef(config) {
{
if (hasOwnProperty.call(config, 'ref')) {
var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
if (getter && getter.isReactWarning) {
return false;
}
}
}
return config.ref !== undefined;
} | Convenience component with default shallow equality check for sCU. | hasValidRef | javascript | facebook/memlab | packages/lens/src/tests/lib/react-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-v18.dev.js | MIT |
function hasValidKey(config) {
{
if (hasOwnProperty.call(config, 'key')) {
var getter = Object.getOwnPropertyDescriptor(config, 'key').get;
if (getter && getter.isReactWarning) {
return false;
}
}
}
return config.key !== undefined;
} | Convenience component with default shallow equality check for sCU. | hasValidKey | javascript | facebook/memlab | packages/lens/src/tests/lib/react-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-v18.dev.js | MIT |
function defineKeyPropWarningGetter(props, displayName) {
var warnAboutAccessingKey = function () {
{
if (!specialPropKeyWarningShown) {
specialPropKeyWarningShown = true;
error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you ne... | Convenience component with default shallow equality check for sCU. | defineKeyPropWarningGetter | javascript | facebook/memlab | packages/lens/src/tests/lib/react-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-v18.dev.js | MIT |
warnAboutAccessingKey = function () {
{
if (!specialPropKeyWarningShown) {
specialPropKeyWarningShown = true;
error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you s... | Convenience component with default shallow equality check for sCU. | warnAboutAccessingKey | javascript | facebook/memlab | packages/lens/src/tests/lib/react-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-v18.dev.js | MIT |
function defineRefPropWarningGetter(props, displayName) {
var warnAboutAccessingRef = function () {
{
if (!specialPropRefWarningShown) {
specialPropRefWarningShown = true;
error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you ne... | Convenience component with default shallow equality check for sCU. | defineRefPropWarningGetter | javascript | facebook/memlab | packages/lens/src/tests/lib/react-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-v18.dev.js | MIT |
warnAboutAccessingRef = function () {
{
if (!specialPropRefWarningShown) {
specialPropRefWarningShown = true;
error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you s... | Convenience component with default shallow equality check for sCU. | warnAboutAccessingRef | javascript | facebook/memlab | packages/lens/src/tests/lib/react-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-v18.dev.js | MIT |
function warnIfStringRefCannotBeAutoConverted(config) {
{
if (typeof config.ref === 'string' && ReactCurrentOwner.current && config.__self && ReactCurrentOwner.current.stateNode !== config.__self) {
var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);
if (!didWarnAbou... | Convenience component with default shallow equality check for sCU. | warnIfStringRefCannotBeAutoConverted | javascript | facebook/memlab | packages/lens/src/tests/lib/react-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-v18.dev.js | MIT |
ReactElement = function (type, key, ref, self, source, owner, props) {
var element = {
// This tag allows us to uniquely identify this as a React Element
$$typeof: REACT_ELEMENT_TYPE,
// Built-in properties that belong on the element
type: type,
key: key,
ref: ref,
props: p... | Factory method to create a new React element. This no longer adheres to
the class pattern, so do not use new to call it. Also, instanceof check
will not work. Instead test $$typeof field against Symbol.for('react.element') to check
if something is a React Element.
@param {*} type
@param {*} props
@param {*} key
@param... | ReactElement | javascript | facebook/memlab | packages/lens/src/tests/lib/react-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-v18.dev.js | MIT |
function createElement(type, config, children) {
var propName; // Reserved names are extracted
var props = {};
var key = null;
var ref = null;
var self = null;
var source = null;
if (config != null) {
if (hasValidRef(config)) {
ref = config.ref;
{
warnIfStr... | Create and return a new ReactElement of the given type.
See https://reactjs.org/docs/react-api.html#createelement | createElement | javascript | facebook/memlab | packages/lens/src/tests/lib/react-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-v18.dev.js | MIT |
function cloneAndReplaceKey(oldElement, newKey) {
var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);
return newElement;
} | Create and return a new ReactElement of the given type.
See https://reactjs.org/docs/react-api.html#createelement | cloneAndReplaceKey | javascript | facebook/memlab | packages/lens/src/tests/lib/react-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-v18.dev.js | MIT |
function cloneElement(element, config, children) {
if (element === null || element === undefined) {
throw new Error("React.cloneElement(...): The argument must be a React element, but you passed " + element + ".");
}
var propName; // Original props are copied
var props = assign({}, element.props... | Clone and return a new ReactElement using element as the starting point.
See https://reactjs.org/docs/react-api.html#cloneelement | cloneElement | javascript | facebook/memlab | packages/lens/src/tests/lib/react-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-v18.dev.js | MIT |
function isValidElement(object) {
return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
} | Verifies the object is a ReactElement.
See https://reactjs.org/docs/react-api.html#isvalidelement
@param {?object} object
@return {boolean} True if `object` is a ReactElement.
@final | isValidElement | javascript | facebook/memlab | packages/lens/src/tests/lib/react-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-v18.dev.js | MIT |
function escape(key) {
var escapeRegex = /[=:]/g;
var escaperLookup = {
'=': '=0',
':': '=2'
};
var escapedString = key.replace(escapeRegex, function (match) {
return escaperLookup[match];
});
return '$' + escapedString;
} | Escape and wrap key so it is safe to use as a reactid
@param {string} key to be escaped.
@return {string} the escaped key. | escape | javascript | facebook/memlab | packages/lens/src/tests/lib/react-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-v18.dev.js | MIT |
function escapeUserProvidedKey(text) {
return text.replace(userProvidedKeyEscapeRegex, '$&/');
} | TODO: Test that a single child and an array with one item have the same key
pattern. | escapeUserProvidedKey | javascript | facebook/memlab | packages/lens/src/tests/lib/react-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-v18.dev.js | MIT |
function getElementKey(element, index) {
// Do some typechecking here since we call this blindly. We want to ensure
// that we don't block potential future ES APIs.
if (typeof element === 'object' && element !== null && element.key != null) {
// Explicit key
{
checkKeyStringCoercion(elem... | Generate a key string that identifies a element within a set.
@param {*} element A element that could contain a manual key.
@param {number} index Index that is used if a manual key is not provided.
@return {string} | getElementKey | javascript | facebook/memlab | packages/lens/src/tests/lib/react-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-v18.dev.js | MIT |
function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
var type = typeof children;
if (type === 'undefined' || type === 'boolean') {
// All of the above are perceived as null.
children = null;
}
var invokeCallback = false;
if (children === null) {
invokeCal... | Generate a key string that identifies a element within a set.
@param {*} element A element that could contain a manual key.
@param {number} index Index that is used if a manual key is not provided.
@return {string} | mapIntoArray | javascript | facebook/memlab | packages/lens/src/tests/lib/react-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-v18.dev.js | MIT |
function mapChildren(children, func, context) {
if (children == null) {
return children;
}
var result = [];
var count = 0;
mapIntoArray(children, result, '', '', function (child) {
return func.call(context, child, count++);
});
return result;
} | Maps children that are typically specified as `props.children`.
See https://reactjs.org/docs/react-api.html#reactchildrenmap
The provided mapFunction(child, index) will be called for each
leaf child.
@param {?*} children Children tree container.
@param {function(*, int)} func The map function.
@param {*} context Con... | mapChildren | javascript | facebook/memlab | packages/lens/src/tests/lib/react-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-v18.dev.js | MIT |
function countChildren(children) {
var n = 0;
mapChildren(children, function () {
n++; // Don't return anything
});
return n;
} | Count the number of children that are typically specified as
`props.children`.
See https://reactjs.org/docs/react-api.html#reactchildrencount
@param {?*} children Children tree container.
@return {number} The number of children. | countChildren | javascript | facebook/memlab | packages/lens/src/tests/lib/react-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-v18.dev.js | MIT |
function forEachChildren(children, forEachFunc, forEachContext) {
mapChildren(children, function () {
forEachFunc.apply(this, arguments); // Don't return anything.
}, forEachContext);
} | Iterates through children that are typically specified as `props.children`.
See https://reactjs.org/docs/react-api.html#reactchildrenforeach
The provided forEachFunc(child, index) will be called for each
leaf child.
@param {?*} children Children tree container.
@param {function(*, int)} forEachFunc
@param {*} forEac... | forEachChildren | javascript | facebook/memlab | packages/lens/src/tests/lib/react-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-v18.dev.js | MIT |
function toArray(children) {
return mapChildren(children, function (child) {
return child;
}) || [];
} | Flatten a children object (typically specified as `props.children`) and
return an array with appropriately re-keyed children.
See https://reactjs.org/docs/react-api.html#reactchildrentoarray | toArray | javascript | facebook/memlab | packages/lens/src/tests/lib/react-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-v18.dev.js | MIT |
function onlyChild(children) {
if (!isValidElement(children)) {
throw new Error('React.Children.only expected to receive a single React element child.');
}
return children;
} | Returns the first child in a collection of children and verifies that there
is only one child in the collection.
See https://reactjs.org/docs/react-api.html#reactchildrenonly
The current implementation of this function assumes that a single child gets
passed without a wrapper, but the purpose of this helper function ... | onlyChild | javascript | facebook/memlab | packages/lens/src/tests/lib/react-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-v18.dev.js | MIT |
function createContext(defaultValue) {
// TODO: Second argument used to be an optional `calculateChangedBits`
// function. Warn to reserve for future use?
var context = {
$$typeof: REACT_CONTEXT_TYPE,
// As a workaround to support multiple concurrent renderers, we categorize
// some render... | Returns the first child in a collection of children and verifies that there
is only one child in the collection.
See https://reactjs.org/docs/react-api.html#reactchildrenonly
The current implementation of this function assumes that a single child gets
passed without a wrapper, but the purpose of this helper function ... | createContext | javascript | facebook/memlab | packages/lens/src/tests/lib/react-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-v18.dev.js | MIT |
function lazyInitializer(payload) {
if (payload._status === Uninitialized) {
var ctor = payload._result;
var thenable = ctor(); // Transition to the next state.
// This might throw either because it's missing or throws. If so, we treat it
// as still uninitialized and try again next time. Wh... | Returns the first child in a collection of children and verifies that there
is only one child in the collection.
See https://reactjs.org/docs/react-api.html#reactchildrenonly
The current implementation of this function assumes that a single child gets
passed without a wrapper, but the purpose of this helper function ... | lazyInitializer | javascript | facebook/memlab | packages/lens/src/tests/lib/react-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-v18.dev.js | MIT |
function lazy(ctor) {
var payload = {
// We use these fields to store the result.
_status: Uninitialized,
_result: ctor
};
var lazyType = {
$$typeof: REACT_LAZY_TYPE,
_payload: payload,
_init: lazyInitializer
};
{
// In production, this would just set it on... | Returns the first child in a collection of children and verifies that there
is only one child in the collection.
See https://reactjs.org/docs/react-api.html#reactchildrenonly
The current implementation of this function assumes that a single child gets
passed without a wrapper, but the purpose of this helper function ... | lazy | javascript | facebook/memlab | packages/lens/src/tests/lib/react-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-v18.dev.js | MIT |
function forwardRef(render) {
{
if (render != null && render.$$typeof === REACT_MEMO_TYPE) {
error('forwardRef requires a render function but received a `memo` ' + 'component. Instead of forwardRef(memo(...)), use ' + 'memo(forwardRef(...)).');
} else if (typeof render !== 'function') {
... | Returns the first child in a collection of children and verifies that there
is only one child in the collection.
See https://reactjs.org/docs/react-api.html#reactchildrenonly
The current implementation of this function assumes that a single child gets
passed without a wrapper, but the purpose of this helper function ... | forwardRef | javascript | facebook/memlab | packages/lens/src/tests/lib/react-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-v18.dev.js | MIT |
function isValidElementType(type) {
if (typeof type === 'string' || typeof type === 'function') {
return true;
} // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).
if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REA... | Returns the first child in a collection of children and verifies that there
is only one child in the collection.
See https://reactjs.org/docs/react-api.html#reactchildrenonly
The current implementation of this function assumes that a single child gets
passed without a wrapper, but the purpose of this helper function ... | isValidElementType | javascript | facebook/memlab | packages/lens/src/tests/lib/react-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-v18.dev.js | MIT |
function memo(type, compare) {
{
if (!isValidElementType(type)) {
error('memo: The first argument must be a component. Instead ' + 'received: %s', type === null ? 'null' : typeof type);
}
}
var elementType = {
$$typeof: REACT_MEMO_TYPE,
type: type,
compare: compare ===... | Returns the first child in a collection of children and verifies that there
is only one child in the collection.
See https://reactjs.org/docs/react-api.html#reactchildrenonly
The current implementation of this function assumes that a single child gets
passed without a wrapper, but the purpose of this helper function ... | memo | javascript | facebook/memlab | packages/lens/src/tests/lib/react-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-v18.dev.js | MIT |
function resolveDispatcher() {
var dispatcher = ReactCurrentDispatcher.current;
{
if (dispatcher === null) {
error('Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for' + ' one of the following reasons:\n' + '1. You might have mismatching ... | Returns the first child in a collection of children and verifies that there
is only one child in the collection.
See https://reactjs.org/docs/react-api.html#reactchildrenonly
The current implementation of this function assumes that a single child gets
passed without a wrapper, but the purpose of this helper function ... | resolveDispatcher | javascript | facebook/memlab | packages/lens/src/tests/lib/react-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-v18.dev.js | MIT |
function useContext(Context) {
var dispatcher = resolveDispatcher();
{
// TODO: add a more generic warning for invalid values.
if (Context._context !== undefined) {
var realContext = Context._context; // Don't deduplicate because this legitimately causes bugs
// and nobody should be... | Returns the first child in a collection of children and verifies that there
is only one child in the collection.
See https://reactjs.org/docs/react-api.html#reactchildrenonly
The current implementation of this function assumes that a single child gets
passed without a wrapper, but the purpose of this helper function ... | useContext | javascript | facebook/memlab | packages/lens/src/tests/lib/react-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-v18.dev.js | MIT |
function useState(initialState) {
var dispatcher = resolveDispatcher();
return dispatcher.useState(initialState);
} | Returns the first child in a collection of children and verifies that there
is only one child in the collection.
See https://reactjs.org/docs/react-api.html#reactchildrenonly
The current implementation of this function assumes that a single child gets
passed without a wrapper, but the purpose of this helper function ... | useState | javascript | facebook/memlab | packages/lens/src/tests/lib/react-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-v18.dev.js | MIT |
function useReducer(reducer, initialArg, init) {
var dispatcher = resolveDispatcher();
return dispatcher.useReducer(reducer, initialArg, init);
} | Returns the first child in a collection of children and verifies that there
is only one child in the collection.
See https://reactjs.org/docs/react-api.html#reactchildrenonly
The current implementation of this function assumes that a single child gets
passed without a wrapper, but the purpose of this helper function ... | useReducer | javascript | facebook/memlab | packages/lens/src/tests/lib/react-v18.dev.js | https://github.com/facebook/memlab/blob/master/packages/lens/src/tests/lib/react-v18.dev.js | MIT |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.