Skip to content

Commit

Permalink
Fix component remount on dev
Browse files Browse the repository at this point in the history
On dev (but not on prod), TracePage is unmounted and remounted, but isMounted.current stays false and the trace tree never renders. This appears to be due to React.StrictMode, as seen in this other bug on another project: apollographql/apollo-client#6037
  • Loading branch information
amosjyng committed Jan 19, 2023
1 parent a05fe09 commit 62ac6d5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions ui/components/TracePage/TracePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ const TreeProvider = ({ traceId, children }: { traceId: string; children: ReactN
const isMounted = useRef(true);

useEffect(() => {
isMounted.current = true;
let timeoutId: ReturnType<typeof setTimeout>;

const poll = async () => {
Expand Down

0 comments on commit 62ac6d5

Please sign in to comment.