Skip to content

Commit 726e89b

Browse files
committed
fix profiler root change error
1 parent 539527b commit 726e89b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/react-devtools-shared/src/devtools/views/Profiler/RootSelector.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ import {ProfilerContext} from './ProfilerContext';
1414
import styles from './RootSelector.css';
1515

1616
export default function RootSelector(_: {||}) {
17-
const {profilingData, rootID, setRootID} = useContext(ProfilerContext);
17+
const {profilingData, rootID, setRootID, selectFiber} = useContext(
18+
ProfilerContext,
19+
);
1820

1921
const options = [];
2022
if (profilingData !== null) {
@@ -29,6 +31,7 @@ export default function RootSelector(_: {||}) {
2931

3032
const handleChange = useCallback(
3133
({currentTarget}) => {
34+
selectFiber(null, null);
3235
setRootID(parseInt(currentTarget.value, 10));
3336
},
3437
[setRootID],

0 commit comments

Comments
 (0)