MCPcopy Index your code
hub / github.com/react/react / createFiberFromProfiler

Function createFiberFromProfiler

packages/react-reconciler/src/ReactFiber.js:771–798  ·  view source on GitHub ↗
(
  pendingProps: any,
  mode: TypeOfMode,
  lanes: Lanes,
  key: null | string,
)

Source from the content-addressed store, hash-verified

769}
770
771function createFiberFromProfiler(
772 pendingProps: any,
773 mode: TypeOfMode,
774 lanes: Lanes,
775 key: null | string,
776): Fiber {
777 if (__DEV__) {
778 if (typeof pendingProps.id !== 'string') {
779 console.error(
780 'Profiler must specify an "id" of type `string` as a prop. Received the type `%s` instead.',
781 typeof pendingProps.id,
782 );
783 }
784 }
785
786 const fiber = createFiber(Profiler, pendingProps, key, mode | ProfileMode);
787 fiber.elementType = REACT_PROFILER_TYPE;
788 fiber.lanes = lanes;
789
790 if (enableProfilerTimer) {
791 fiber.stateNode = {
792 effectDuration: 0,
793 passiveEffectDuration: 0,
794 };
795 }
796
797 return fiber;
798}
799
800export function createFiberFromSuspense(
801 pendingProps: any,

Callers 1

Calls 1

errorMethod · 0.65

Tested by

no test coverage detected