MCPcopy Create free account
hub / github.com/benjitaylor/agentation / createMockFiber

Function createMockFiber

package/src/utils/react-detection.test.ts:22–33  ·  view source on GitHub ↗
(
  name: string,
  parent?: MockFiber,
  options: { tag?: number } = {},
)

Source from the content-addressed store, hash-verified

20
21// Helper to create a mock fiber
22function createMockFiber(
23 name: string,
24 parent?: MockFiber,
25 options: { tag?: number } = {},
26): MockFiber {
27 return {
28 tag: options.tag ?? 0, // FunctionComponent
29 type: { name, displayName: name },
30 elementType: { name, displayName: name },
31 return: parent || null,
32 };
33}
34
35// Helper to attach fiber to an element
36function attachFiber(element: HTMLElement, fiber: unknown) {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…