Download react-grid-layout/test/examples/test_demo.jsx from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 500 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/react-grid-layout/test/examples/test_demo.jsx
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/react-grid-layout/test/examples/test_demo.jsx
-
curl -L -o test_demo.jsx https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/react-grid-layout/test/examples/test_demo.jsx
500 Bytes
| import React from 'react'; | |
| import RGL, { WidthProvider } from 'react-grid-layout'; | |
| const ReactGridLayout = WidthProvider(RGL); | |
| export const IsBounded = ({ onDragStop }) => { | |
| const layout = [ | |
| { i: '0', x: 0, y: 0, w: 1, h: 1 }, | |
| { i: '1', x: 1, y: 0, w: 1, h: 1 }, | |
| ] | |
| return ( | |
| <ReactGridLayout | |
| layout={layout} | |
| isBounded={true} | |
| onDragStop={onDragStop} | |
| > | |
| { | |
| layout.map(ele => <div key={ele.i}>{ele.i}</div>) | |
| } | |
| </ReactGridLayout> | |
| ); | |
| }; | |