diff --git a/packages/react/src/profiler.tsx b/packages/react/src/profiler.tsx index 2a083ca130b1..8cf86ed89009 100644 --- a/packages/react/src/profiler.tsx +++ b/packages/react/src/profiler.tsx @@ -133,7 +133,7 @@ function withProfiler

(WrappedComponent: React.ComponentType

* @param name displayName of component being profiled */ function useProfiler(name: string): void { - const activity = getInitActivity(name); + const [activity] = React.useState(() => getInitActivity(name)); React.useEffect(() => { afterNextFrame(() => {