Skip to content

Commit aaf40f4

Browse files
committed
change name
1 parent d840ca5 commit aaf40f4

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export type Context = {|
4343
// 1. The selected root in the Components tree (if it has any profiling data) or
4444
// 2. The first root in the list with profiling data.
4545
rootID: number | null,
46-
setRootIDcleanFiber: (id: number) => void,
46+
setRootID: (id: number) => void,
4747

4848
// Controls whether commits are filtered by duration.
4949
// This value is controlled by a filter toggle UI in the Profiler toolbar.
@@ -154,7 +154,7 @@ function ProfilerContextController({children}: Props) {
154154
[dispatch, selectFiberID, selectFiberName, store],
155155
);
156156

157-
const setRootIDcleanFiber = useCallback(
157+
const setRootIDAndClearFiber = useCallback(
158158
(id: number | null) => {
159159
selectFiber(null, null);
160160
setRootID(id);
@@ -182,9 +182,9 @@ function ProfilerContextController({children}: Props) {
182182
selectedElementRootID !== null &&
183183
dataForRoots.has(selectedElementRootID)
184184
) {
185-
setRootIDcleanFiber(selectedElementRootID);
185+
setRootIDAndClearFiber(selectedElementRootID);
186186
} else {
187-
setRootIDcleanFiber(firstRootID);
187+
setRootIDAndClearFiber(firstRootID);
188188
}
189189
}
190190
}
@@ -245,7 +245,7 @@ function ProfilerContextController({children}: Props) {
245245
supportsProfiling,
246246

247247
rootID,
248-
setRootIDcleanFiber,
248+
setRootID: setRootIDAndClearFiber,
249249

250250
isCommitFilterEnabled,
251251
setIsCommitFilterEnabled,
@@ -275,7 +275,8 @@ function ProfilerContextController({children}: Props) {
275275
supportsProfiling,
276276

277277
rootID,
278-
setRootIDcleanFiber,
278+
setRootID,
279+
setRootIDAndClearFiber,
279280

280281
isCommitFilterEnabled,
281282
setIsCommitFilterEnabled,

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

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

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

2119
const options = [];
2220
if (profilingData !== null) {
@@ -31,9 +29,9 @@ export default function RootSelector(_: {||}) {
3129

3230
const handleChange = useCallback(
3331
({currentTarget}) => {
34-
setRootIDcleanFiber(parseInt(currentTarget.value, 10));
32+
setRootID(parseInt(currentTarget.value, 10));
3533
},
36-
[setRootIDcleanFiber],
34+
[setRootID],
3735
);
3836

3937
if (profilingData === null || profilingData.dataForRoots.size <= 1) {

0 commit comments

Comments
 (0)