-
Notifications
You must be signed in to change notification settings - Fork 812
/
Copy pathapp.js
41 lines (36 loc) · 932 Bytes
/
app.js
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
39
40
41
import React, { Component } from 'react';
import ReactDOM from 'react-dom';
import Modal from 'react-modal';
import SimpleUsage from './simple_usage';
import MultipleModals from './multiple_modals';
import Forms from './forms';
import ReactRouter from './react-router';
import NestedModals from './nested_modals';
const appElement = document.getElementById('example');
Modal.setAppElement('#example');
const examples = [
SimpleUsage,
Forms,
MultipleModals,
NestedModals,
ReactRouter,
ModalClose
];
class App extends Component {
render() {
return (
<div>
{examples.map((example, key) => {
const ExampleApp = example.app;
return (
<div key={key + 1} className="example">
<h3>{`#${key + 1}. ${example.label}`}</h3>
<ExampleApp />
</div>
);
})}
</div>
);
}
}
ReactDOM.render(<App />, appElement);