Skip to content
This repository has been archived by the owner on Feb 25, 2020. It is now read-only.

Commit

Permalink
fix: proper prop naming on module declaration
Browse files Browse the repository at this point in the history
  • Loading branch information
Damian Sznajder committed Aug 3, 2019
1 parent 9434c59 commit be788e9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/index.tsx
Expand Up @@ -29,13 +29,13 @@ const DEFAULT_TRANSITION = (

interface Props {
navigation: NavigationProp<NavigationState> & {
navigationConfig: { transition?: React.ElementType<Transition> };
navigationConfig: { transition?: React.ReactNode };
};
descriptors: { [key: string]: NavigationDescriptor };
screenProps?: ScreenProps;
}

class AnimatedSwitchView extends React.Component<Props> {
class AnimatedSwitchView extends React.Component<Props, {}> {
containerRef = React.createRef<TransitioningView>();

componentDidUpdate(prevProps: Props) {
Expand Down Expand Up @@ -75,13 +75,13 @@ class AnimatedSwitchView extends React.Component<Props> {
}

export interface AnimatedSwitchNavigatorConfig extends SwitchNavigatorConfig {
transition?: React.ElementType<Transition>;
transition?: React.ReactNode;
}

export default function createAnimatedSwitchNavigator(
routeConfigMap: NavigationRouteConfigMap,
switchConfig: SwitchNavigatorConfig & {
transition?: React.ElementType<Transition>;
transition?: React.ReactNode;
}
): NavigationContainer {
const router = SwitchRouter(routeConfigMap, switchConfig);
Expand Down
7 changes: 4 additions & 3 deletions types/@react-navigation/core.d.ts
Expand Up @@ -5,6 +5,7 @@ declare module '@react-navigation/core' {
NavigationRouteConfigMap,
NavigationContainer,
SwitchNavigatorConfig,
NavigationRouter,
} from 'react-navigation';

export const SceneView: React.ComponentType<{
Expand All @@ -15,14 +16,14 @@ declare module '@react-navigation/core' {

export function createNavigator(
StackView: React.ComponentType<any>,
router: any,
stackConfig: object
router: NavigationRouter<S, Options>,
navigatorConfig?: {} | null
): NavigationContainer;

export function SwitchRouter(
routeConfigMap: NavigationRouteConfigMap,
switchConfig: SwitchNavigatorConfig & {
transition?: React.ElementType<Transition>;
transition?: React.ReactNode;
}
);
}

0 comments on commit be788e9

Please sign in to comment.