Remove es6-class style tests

This commit is contained in:
Yui T 2016-11-12 22:38:00 -08:00
parent fe9ddf224e
commit 2396a70919
2 changed files with 5 additions and 26 deletions

View File

@ -3,8 +3,6 @@
// Definitions by: Karol Janyst <https://github.com/LKay>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
import * as React from "react"
declare namespace ReactOnClickOutside {
interface OnClickOutsideComponent {
handleClickOutside(e: React.MouseEvent<any>): void
@ -24,7 +22,5 @@ declare namespace ReactOnClickOutside {
}
}
declare module "react-onclickoutside" {
const onClickOutside: ReactOnClickOutside.onClickOutside
export = onClickOutside
}
declare const onClickOutside: ReactOnClickOutside.onClickOutside
export = onClickOutside;

View File

@ -8,22 +8,14 @@ import { Component, StatelessComponent, MouseEvent } from "react"
import { render } from "react-dom"
import * as onClickOutside from "react-onclickoutside"
interface TestProps extends ReactOnClickOutside.OnClickOutsideProps {}
interface TestProps {}
var TestStateless: StatelessComponent<TestProps> = (props: TestProps) => {
return (<div>Test</div>)
}
var TestStatelessWrapped = onClickOutside(TestStateless)
class Test extends Component<TestProps, any> implements ReactOnClickOutside.OnClickOutsideComponent {
handleClickOutside (e: MouseEvent<any>) {}
render () {
return (<div>Test</div>)
}
}
var TestWrapped = onClickOutside(Test)
render(
<TestStatelessWrapped eventTypes="click"
disableOnClickOutside
@ -31,13 +23,4 @@ render(
stopPropagation
outsideClickIgnoreClass="ignore" />,
document.getElementById("main")
)
render(
<TestWrapped eventTypes={ ["click", "touchend"] }
disableOnClickOutside
preventDefault
stopPropagation
outsideClickIgnoreClass="ignore" />,
document.getElementById("main")
)
)