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

Function createCursor

packages/react-reconciler/src/ReactFiberStack.js:24–28  ·  view source on GitHub ↗
(defaultValue: T)

Source from the content-addressed store, hash-verified

22let index = -1;
23
24function createCursor<T>(defaultValue: T): StackCursor<T> {
25 return {
26 current: defaultValue,
27 };
28}
29
30function pop<T>(cursor: StackCursor<T>, fiber: Fiber): void {
31 if (index < 0) {

Calls

no outgoing calls

Tested by

no test coverage detected