forked from module-federation/module-federation-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.jsx
More file actions
38 lines (37 loc) · 900 Bytes
/
App.jsx
File metadata and controls
38 lines (37 loc) · 900 Bytes
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
35
36
37
38
import React from 'lib-app/react';
import Logo from './src/Logo';
import Dialog from './src/Dialog';
import Button from './src/Button';
export default class App extends React.Component {
constructor(props) {
super(props);
this.state = {
dialogVisible: false,
};
this.handleClick = this.handleClick.bind(this);
this.HanldeSwitchVisible = this.HanldeSwitchVisible.bind(this);
}
handleClick(ev) {
console.log(ev);
this.setState({
dialogVisible: true,
});
}
HanldeSwitchVisible(visible) {
this.setState({
dialogVisible: visible,
});
}
render() {
return (
<div>
<Logo />
<br />
<Button />
<br />
<button onClick={this.handleClick}>click to open dialog</button>
<Dialog switchVisible={this.HanldeSwitchVisible} visible={this.state.dialogVisible} />
</div>
);
}
}