refactor: rename NativeContainer -> NavigationNativeContainer

This commit is contained in:
satyajit.happy
2019-08-31 21:01:34 +02:00
parent b0a3756d18
commit fe9ba2bf71
3 changed files with 13 additions and 7 deletions

View File

@@ -8,7 +8,10 @@ import {
getStateFromPath,
NavigationContainerRef,
} from '@react-navigation/core';
import { useLinking, NativeContainer } from '@react-navigation/native';
import {
useLinking,
NavigationNativeContainer,
} from '@react-navigation/native';
import {
createDrawerNavigator,
DrawerNavigationProp,
@@ -118,7 +121,7 @@ export default function App() {
}
return (
<NativeContainer
<NavigationNativeContainer
ref={containerRef}
initialState={initialState}
onStateChange={state =>
@@ -177,6 +180,6 @@ export default function App() {
)}
</Drawer.Screen>
</Drawer.Navigator>
</NativeContainer>
</NavigationNativeContainer>
);
}

View File

@@ -16,14 +16,14 @@ import useBackButton from './useBackButton';
* @param props.children Child elements to render the content.
* @param props.ref Ref object which refers to the navigation object containing helper methods.
*/
const NativeContainer = React.forwardRef(function NativeContainer(
const NavigationNativeContainer = React.forwardRef(function NativeContainer(
props: NavigationContainerProps,
ref: React.Ref<NavigationContainerRef>
) {
const refContainer = React.useRef<NavigationContainerRef>(null);
useBackButton(refContainer);
React.useImperativeHandle(ref, () => refContainer.current);
return (
@@ -35,4 +35,4 @@ const NativeContainer = React.forwardRef(function NativeContainer(
);
});
export default NativeContainer;
export default NavigationNativeContainer;

View File

@@ -1,4 +1,7 @@
export { default as NativeContainer } from './NativeContainer';
export {
default as NavigationNativeContainer,
} from './NavigationNativeContainer';
export { default as useBackButton } from './useBackButton';
export { default as useLinking } from './useLinking';
export { default as useScrollToTop } from './useScrollToTop';