From 71394cdb0168bbb5b137f2d296bbc0b43e7aeee5 Mon Sep 17 00:00:00 2001 From: Nick Reiley Date: Tue, 12 May 2020 23:52:20 +0500 Subject: [PATCH] change name --- .../src/devtools/views/Profiler/ProfilerContext.js | 13 +++++++------ .../src/devtools/views/Profiler/RootSelector.js | 6 +++--- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/packages/react-devtools-shared/src/devtools/views/Profiler/ProfilerContext.js b/packages/react-devtools-shared/src/devtools/views/Profiler/ProfilerContext.js index 3346b2fa54c18..1108a6bb64ff0 100644 --- a/packages/react-devtools-shared/src/devtools/views/Profiler/ProfilerContext.js +++ b/packages/react-devtools-shared/src/devtools/views/Profiler/ProfilerContext.js @@ -43,7 +43,7 @@ export type Context = {| // 1. The selected root in the Components tree (if it has any profiling data) or // 2. The first root in the list with profiling data. rootID: number | null, - setRootIDcleanFiber: (id: number) => void, + setRootID: (id: number) => void, // Controls whether commits are filtered by duration. // This value is controlled by a filter toggle UI in the Profiler toolbar. @@ -154,7 +154,7 @@ function ProfilerContextController({children}: Props) { [dispatch, selectFiberID, selectFiberName, store], ); - const setRootIDcleanFiber = useCallback( + const setRootIDAndClearFiber = useCallback( (id: number | null) => { selectFiber(null, null); setRootID(id); @@ -182,9 +182,9 @@ function ProfilerContextController({children}: Props) { selectedElementRootID !== null && dataForRoots.has(selectedElementRootID) ) { - setRootIDcleanFiber(selectedElementRootID); + setRootIDAndClearFiber(selectedElementRootID); } else { - setRootIDcleanFiber(firstRootID); + setRootIDAndClearFiber(firstRootID); } } } @@ -245,7 +245,7 @@ function ProfilerContextController({children}: Props) { supportsProfiling, rootID, - setRootIDcleanFiber, + setRootID: setRootIDAndClearFiber, isCommitFilterEnabled, setIsCommitFilterEnabled, @@ -275,7 +275,8 @@ function ProfilerContextController({children}: Props) { supportsProfiling, rootID, - setRootIDcleanFiber, + setRootID, + setRootIDAndClearFiber, isCommitFilterEnabled, setIsCommitFilterEnabled, diff --git a/packages/react-devtools-shared/src/devtools/views/Profiler/RootSelector.js b/packages/react-devtools-shared/src/devtools/views/Profiler/RootSelector.js index c9c77290c867f..a4eeba9a4da34 100644 --- a/packages/react-devtools-shared/src/devtools/views/Profiler/RootSelector.js +++ b/packages/react-devtools-shared/src/devtools/views/Profiler/RootSelector.js @@ -14,7 +14,7 @@ import {ProfilerContext} from './ProfilerContext'; import styles from './RootSelector.css'; export default function RootSelector(_: {||}) { - const {profilingData, rootID, setRootIDcleanFiber} = useContext( + const {profilingData, rootID, setRootID} = useContext( ProfilerContext, ); @@ -31,9 +31,9 @@ export default function RootSelector(_: {||}) { const handleChange = useCallback( ({currentTarget}) => { - setRootIDcleanFiber(parseInt(currentTarget.value, 10)); + setRootID(parseInt(currentTarget.value, 10)); }, - [setRootIDcleanFiber], + [setRootID], ); if (profilingData === null || profilingData.dataForRoots.size <= 1) {