Skip to content

Commit 1db3474

Browse files
committed
fix(react): Prevent state updates from creating activities
1 parent a4a73f7 commit 1db3474

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/react/src/profiler.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ function withProfiler<P extends object>(WrappedComponent: React.ComponentType<P>
133133
* @param name displayName of component being profiled
134134
*/
135135
function useProfiler(name: string): void {
136-
const activity = getInitActivity(name);
136+
const [activity] = React.useState(() => getInitActivity(name));
137137

138138
React.useEffect(() => {
139139
afterNextFrame(() => {

0 commit comments

Comments
 (0)