mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
* Use correct type for GatewayDestProps component * Test react-gateway GatewayDest component prop type * Add another test for react-gateway GatewayDest component prop type
49 lines
1.3 KiB
TypeScript
49 lines
1.3 KiB
TypeScript
import * as React from 'react';
|
|
import { Gateway, GatewayProvider, GatewayDest } from 'react-gateway';
|
|
|
|
class GatewayComponent extends React.Component {
|
|
render() {
|
|
return (
|
|
<div>{this.props.children}</div>
|
|
);
|
|
}
|
|
}
|
|
|
|
class ReactGateway extends React.Component<Gateway.GatewayProps> {
|
|
render() {
|
|
return (
|
|
<Gateway {...this.props}>
|
|
<div>
|
|
Text goes here.
|
|
</div>
|
|
</Gateway>
|
|
);
|
|
}
|
|
}
|
|
|
|
class ReactGatewayProvider extends React.Component {
|
|
render() {
|
|
return (
|
|
<GatewayProvider>
|
|
<GatewayDest name="test" component={GatewayComponent} />
|
|
<GatewayDest name="test2" component="span" />
|
|
<GatewayDest name="test3" />
|
|
<div>
|
|
All the way down...
|
|
<div>
|
|
Almost there...
|
|
<div>
|
|
Getting close...
|
|
<div>
|
|
<ReactGateway into="test" />
|
|
<ReactGateway into="test2" />
|
|
<ReactGateway into="test3" />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</GatewayProvider>
|
|
);
|
|
}
|
|
}
|