import React from 'react';
import CheckTreePicker from 'rsuite/CheckTreePicker';
import 'rsuite/dist/rsuite.min.css';
import { Label } from '@thumbtack/thumbprint-react';
export default function App() {
// Sample Options
const data = [
{
"label": "GeeksforGeeks",
"value": 1,
"children": [
{
"label": "Machine Learning",
"value": 2
},
{
"label": "Data Structures",
"value": 3,
"children": [
{
"label": "Java",
"value": 4
},
{
"label": "C++",
"value": 5
},
{
"label": "Python",
"value": 6
},
{
"label": "C#",
"value": 7
},
]
}
]
},
{
"label": "StackOverFlow",
"value": 8,
"children": [
{
"label": "Databases",
"value": 9
},
{
"label": "Operating System",
"value": 10,
"children": [
{
"label": "linux",
"value": 11
},
{
"label": "Windows",
"value": 12
}
]
}
]
},
{
"label": "Tutorial Point",
"value": 13,
"children": [
{
"label": "Engineering Mathematics",
"value": 14
},
{
"label": "Theory of Computation",
"value": 15
}
]
}
]
return (
<div className="App">
<h1 style={{ color: 'green' }} >
GeeksforGeeks</h1>
<h3>React Suite CheckTreePicker Disabled
and ReadOnly</h3>
<Label>Disabled: </Label>
<CheckTreePicker disabled data={data}
defaultValue={[2]}
style={{ width: '50%' }} />
<br />
<hr />
<Label>Disabled option: </Label>
<CheckTreePicker
defaultExpandAll
data={data}
disabledItemValues={[1, 3, 13]}
style={{ width: '50%' }}
/>
<br />
<hr />
</div>
);
}