Skip to content

Commit

Permalink
fix(react): Prevent state updates from creating activities
Browse files Browse the repository at this point in the history
  • Loading branch information
AbhiPrasad committed Jun 9, 2020
1 parent baf1631 commit 23a96b5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/react/src/profiler.tsx
Expand Up @@ -133,7 +133,7 @@ function withProfiler<P extends object>(WrappedComponent: React.ComponentType<P>
* @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(() => {
Expand Down

0 comments on commit 23a96b5

Please sign in to comment.