-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.tsx
34 lines (27 loc) · 801 Bytes
/
index.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import React, { Component } from 'react';
import { render } from 'react-dom';
import MouseWithRenderProp from './app/MouseWithRenderProp';
import MouseWithChildrenAsRenderProp from './app/MouseWithChildrenAsRenderProp';
import Cat from './app/Cat';
import withMouseHOC from './app/withMouseHOC';
interface AppProps {}
interface AppState {
name: string;
}
class App extends Component<AppProps, AppState> {
constructor(props) {
super(props);
}
render() {
return (
<div>
<MouseWithRenderProp render={(mouse) => <Cat mouse={mouse} />} />
<MouseWithChildrenAsRenderProp>
{(mouse) => <Cat mouse={mouse} />}
</MouseWithChildrenAsRenderProp>
{withMouseHOC(Cat)}
</div>
);
}
}
render(<App />, document.getElementById('root'));