Skip to content

Commit b2ad4ae

Browse files
committed
change name
1 parent d840ca5 commit b2ad4ae

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

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

+7-6
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+
setRootIDAndClearFiber: (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

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {ProfilerContext} from './ProfilerContext';
1414
import styles from './RootSelector.css';
1515

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

@@ -31,9 +31,9 @@ export default function RootSelector(_: {||}) {
3131

3232
const handleChange = useCallback(
3333
({currentTarget}) => {
34-
setRootIDcleanFiber(parseInt(currentTarget.value, 10));
34+
setRootID(parseInt(currentTarget.value, 10));
3535
},
36-
[setRootIDcleanFiber],
36+
[setRootID],
3737
);
3838

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

0 commit comments

Comments
 (0)