chore: temporarily disables devtools until we add a public API

closes #7726
This commit is contained in:
Satyajit Sahoo
2020-03-19 18:39:04 +01:00
parent b1fe73097f
commit d5bb357053
2 changed files with 4 additions and 1 deletions

View File

@@ -136,6 +136,7 @@ const BaseNavigationContainer = React.forwardRef(
);
const { trackState, trackAction } = useDevTools({
enabled: false,
name: '@react-navigation',
reset,
state,

View File

@@ -8,6 +8,7 @@ import {
type State = NavigationState | PartialState<NavigationState> | undefined;
type Options = {
enabled: boolean;
name: string;
reset: (state: NavigationState) => void;
state: State;
@@ -35,10 +36,11 @@ declare global {
}
}
export default function useDevTools({ name, reset, state }: Options) {
export default function useDevTools({ name, reset, state, enabled }: Options) {
const devToolsRef = React.useRef<DevTools>();
if (
enabled &&
process.env.NODE_ENV !== 'production' &&
global.__REDUX_DEVTOOLS_EXTENSION__ &&
devToolsRef.current === undefined