Skip to content

Commit 5cce14f

Browse files
committed
clean up unnecessary isMounted check from App.tsx
1 parent 35508f5 commit 5cce14f

2 files changed

Lines changed: 3 additions & 6 deletions

File tree

client/modules/App/App.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,6 @@ export const App = ({ children }: { children?: React.ReactNode }) => {
3333
dispatch(setLanguage(language, { persistPreference: false }));
3434
}, [language]);
3535

36-
// TODO: do we actually need this? - Linda
37-
const [isMounted, setIsMounted] = useState(false);
38-
useEffect(() => setIsMounted(true), []);
39-
4036
const previousLocationRef = useRef(location);
4137
useEffect(() => {
4238
const prevLocation = previousLocationRef.current;
@@ -54,7 +50,7 @@ export const App = ({ children }: { children?: React.ReactNode }) => {
5450
return (
5551
<div className="app">
5652
<CookieConsent hide={hide} />
57-
{isMounted && showReduxDevTools() && <DevTools />}
53+
{showReduxDevTools() && <DevTools />}
5854
{children}
5955
</div>
6056
);

client/store.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@ import rootReducer from './reducers';
55
import type { RootState } from './reducers';
66
import { clearState, loadState } from './persistState';
77
import { getConfig } from './utils/getConfig';
8+
import { parseBoolean } from './utils/parseStringToType';
89

910
// Enable DevTools only when rendering on client and during development.
1011
// Display the dock monitor only if no browser extension is found.
1112
export function showReduxDevTools() {
1213
return (
13-
getConfig('CLIENT') &&
14+
parseBoolean(getConfig('CLIENT'), true) &&
1415
getConfig('NODE_ENV') === 'development' &&
1516
!window.__REDUX_DEVTOOLS_EXTENSION__
1617
);

0 commit comments

Comments
 (0)