From 89a3abfbff841cfd8dbe0ccd7bfecf425397ef2c Mon Sep 17 00:00:00 2001 From: Daniel K Date: Mon, 9 Apr 2018 22:27:22 +0200 Subject: [PATCH] Change RRN.Link.component to ComponentType (#24758) --- types/react-router-native/index.d.ts | 2 +- .../react-router-native-tests.tsx | 16 +++++++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/types/react-router-native/index.d.ts b/types/react-router-native/index.d.ts index 17601361bd..ea2a5f766c 100644 --- a/types/react-router-native/index.d.ts +++ b/types/react-router-native/index.d.ts @@ -33,7 +33,7 @@ export class AndroidBackButton extends React.Component {} export class DeepLinking extends React.Component {} export interface LinkProps { - component?: React.Component | React.ComponentClass; + component?: React.ComponentType; replace?: boolean; style?: any; to: H.LocationDescriptor; diff --git a/types/react-router-native/react-router-native-tests.tsx b/types/react-router-native/react-router-native-tests.tsx index 2cbdfac1b2..5b7dcfa4e7 100644 --- a/types/react-router-native/react-router-native-tests.tsx +++ b/types/react-router-native/react-router-native-tests.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; -import { StyleSheet, Text, View } from 'react-native'; -import { NativeRouter as Router, Route, Link, AndroidBackButton, BackButton } from 'react-router-native'; +import { StyleSheet, Text, TouchableOpacity, TouchableOpacityProperties, View } from 'react-native'; +import { AndroidBackButton, BackButton, Link, NativeRouter as Router, Route } from 'react-router-native'; const Home: React.SFC = () => { return ( @@ -24,6 +24,14 @@ const About: React.SFC = () => { ); }; +interface ButtonTextProps extends TouchableOpacityProperties { + text: string; +} + +const ButtonText: React.SFC = ({ text, ...props }) => ( + {text} +); + export default class App extends React.Component { render() { return ( @@ -35,9 +43,7 @@ export default class App extends React.Component { Home - - About - +