mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-12 12:10:44 +08:00
Add ReactShallowRenderer types
See http://facebook.github.io/react/docs/test-utils.html#shallow-rendering
This commit is contained in:
Vendored
+8
@@ -179,6 +179,8 @@ declare module React {
|
||||
findRenderedComponentWithType<C extends Component<any, any>>(
|
||||
tree: Component<any, any>,
|
||||
type: ComponentClass<any>): C;
|
||||
|
||||
createRenderer(): ShallowRenderer;
|
||||
}
|
||||
|
||||
interface SyntheticEventData {
|
||||
@@ -255,5 +257,11 @@ declare module React {
|
||||
touchStart: EventSimulator;
|
||||
wheel: EventSimulator;
|
||||
}
|
||||
|
||||
class ShallowRenderer {
|
||||
getRenderOutput<C extends Component<any, any>>(): C;
|
||||
render(element: ReactElement<any>, context?: any): void;
|
||||
unmount(): void;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user