mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-09-22 09:00:31 +00:00
Merge pull request #30440 from mattmccutchen/react-navigation-strictfunctiontypes
react-navigation: Make declarations work with strictFunctionTypes.
This commit is contained in:
Vendored
+13
-13
@@ -1273,17 +1273,17 @@ export interface NavigationInjectedProps<P = NavigationParams> {
|
||||
}
|
||||
|
||||
// If the wrapped component is a class, we can get a ref to it
|
||||
export function withNavigation<T extends React.ComponentClass<NavigationInjectedProps>>(
|
||||
Component: T,
|
||||
): React.ComponentType<Omit<InferProps<T>, keyof NavigationInjectedProps> & { onRef?: React.Ref<InstanceType<T>> }>;
|
||||
export function withNavigation<P extends NavigationInjectedProps, T extends React.ComponentClass<P>>(
|
||||
Component: T & React.ComponentClass<P>,
|
||||
): React.ComponentType<Omit<P, keyof NavigationInjectedProps> & { onRef?: React.Ref<InstanceType<T>> }>;
|
||||
|
||||
export function withNavigation<T extends React.ComponentType<NavigationInjectedProps>>(
|
||||
Component: T,
|
||||
): React.ComponentType<Omit<InferProps<T>, keyof NavigationInjectedProps>>;
|
||||
export function withNavigation<P extends NavigationInjectedProps>(
|
||||
Component: React.ComponentType<P>,
|
||||
): React.ComponentType<Omit<P, keyof NavigationInjectedProps>>;
|
||||
|
||||
// For backwards compatibility
|
||||
export function withNavigation<T = {}, P = NavigationParams>(
|
||||
Component: React.ComponentType<T | (T & NavigationInjectedProps<P>)>,
|
||||
Component: React.ComponentType<T & NavigationInjectedProps<P>>,
|
||||
): React.ComponentType<T & { onRef?: React.Ref<React.Component<T & NavigationInjectedProps<P>>> }>;
|
||||
|
||||
export interface NavigationFocusInjectedProps<P = NavigationParams> extends NavigationInjectedProps<P> {
|
||||
@@ -1291,13 +1291,13 @@ export interface NavigationFocusInjectedProps<P = NavigationParams> extends Navi
|
||||
}
|
||||
|
||||
// If the wrapped component is a class, we can get a ref to it
|
||||
export function withNavigationFocus<T extends React.ComponentClass<NavigationFocusInjectedProps>>(
|
||||
Component: T,
|
||||
): React.ComponentType<Omit<InferProps<T>, keyof NavigationFocusInjectedProps> & { onRef?: React.Ref<InstanceType<T>> }>;
|
||||
export function withNavigationFocus<P extends NavigationFocusInjectedProps, T extends React.ComponentClass<P>>(
|
||||
Component: T & React.ComponentClass<P>,
|
||||
): React.ComponentType<Omit<P, keyof NavigationFocusInjectedProps> & { onRef?: React.Ref<InstanceType<T>> }>;
|
||||
|
||||
export function withNavigationFocus<T extends React.ComponentType<NavigationFocusInjectedProps>>(
|
||||
Component: T,
|
||||
): React.ComponentType<Omit<InferProps<T>, keyof NavigationFocusInjectedProps>>;
|
||||
export function withNavigationFocus<P extends NavigationFocusInjectedProps>(
|
||||
Component: React.ComponentType<P>,
|
||||
): React.ComponentType<Omit<P, keyof NavigationFocusInjectedProps>>;
|
||||
|
||||
// For backwards compatibility
|
||||
export function withNavigationFocus<T = {}, P = NavigationParams>(
|
||||
|
||||
@@ -413,14 +413,14 @@ class CustomTransitioner extends React.Component<CustomTransitionerProps, null>
|
||||
/>
|
||||
);
|
||||
}
|
||||
_render = (props: NavigationTransitionProps, prevProps: NavigationTransitionProps): React.ReactElement<any> => {
|
||||
_render = (props: NavigationTransitionProps, prevProps?: NavigationTransitionProps): React.ReactElement<any> => {
|
||||
return (
|
||||
<View />
|
||||
);
|
||||
}
|
||||
_configureTransition = (
|
||||
_transitionProps: NavigationTransitionProps,
|
||||
_prevTransitionProps: NavigationTransitionProps
|
||||
_prevTransitionProps?: NavigationTransitionProps
|
||||
) => {
|
||||
return {};
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": false,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"jsx": "react",
|
||||
"typeRoots": [
|
||||
|
||||
Reference in New Issue
Block a user