-
Notifications
You must be signed in to change notification settings - Fork 113
/
Nested.js
37 lines (31 loc) · 891 Bytes
/
Nested.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
import React from 'react';
import {Collapse} from '../../src';
import {VariableHeight} from './VariableHeight';
export class Nested extends React.PureComponent {
constructor(props) {
super(props);
this.state = {isOpened: false};
}
render() {
const {isOpened} = this.state;
return (
<div>
<div className="config">
<label className="label">
Opened:
<input
className="input"
type="checkbox"
checked={isOpened}
onChange={({target: {checked}}) => this.setState({isOpened: checked})} />
</label>
</div>
<Collapse isOpened={isOpened}>
<VariableHeight className="subCollapse" />
<VariableHeight className="subCollapse" />
<VariableHeight className="subCollapse" />
</Collapse>
</div>
);
}
}