From 08cd3c3b367e6111e5fd1b3e65433c1e8068716f Mon Sep 17 00:00:00 2001 From: Kamil Waheed Date: Sat, 21 Jul 2018 03:53:51 +0300 Subject: [PATCH] Fix incorrectly typed GatewayDest's component prop in react-gateway (#27414) * Use correct type for GatewayDestProps component * Test react-gateway GatewayDest component prop type * Add another test for react-gateway GatewayDest component prop type --- types/react-gateway/GatewayDest.d.ts | 2 +- types/react-gateway/react-gateway-tests.tsx | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/types/react-gateway/GatewayDest.d.ts b/types/react-gateway/GatewayDest.d.ts index 4fd7928b2f..ad45947d4c 100644 --- a/types/react-gateway/GatewayDest.d.ts +++ b/types/react-gateway/GatewayDest.d.ts @@ -4,7 +4,7 @@ declare namespace GatewayDest { interface GatewayDestProps { name: string; tagName?: string; - component?: string | React.Component; + component?: string | React.ComponentClass; } } declare class GatewayDest extends React.Component { } diff --git a/types/react-gateway/react-gateway-tests.tsx b/types/react-gateway/react-gateway-tests.tsx index bbf24dd741..6d0642f591 100644 --- a/types/react-gateway/react-gateway-tests.tsx +++ b/types/react-gateway/react-gateway-tests.tsx @@ -1,6 +1,14 @@ import * as React from 'react'; import { Gateway, GatewayProvider, GatewayDest } from 'react-gateway'; +class GatewayComponent extends React.Component { + render() { + return ( +
{this.props.children}
+ ); + } +} + class ReactGateway extends React.Component { render() { return ( @@ -17,7 +25,9 @@ class ReactGatewayProvider extends React.Component { render() { return ( - + + +
All the way down...
@@ -26,6 +36,8 @@ class ReactGatewayProvider extends React.Component { Getting close...
+ +