diff --git a/react/README.md b/react/README.md index 74872fd4a..38185e285 100644 --- a/react/README.md +++ b/react/README.md @@ -1,50 +1,120 @@ -# React + TypeScript + Vite +# React GridStack Wrapper Demo -This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules. +A React wrapper component for GridStack that provides better TypeScript support and React integration experience. -Currently, two official plugins are available: +## TODO -- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh -- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh +- [x] Component mapping +- [x] SubGrid support +- [ ] Save and restore layout +- [ ] Publish to npm -## Expanding the ESLint configuration +## Basic Usage -If you are developing a production application, we recommend updating the configuration to enable type aware lint rules: +This is not an npm package, it's just a demo project. Please copy the relevant code to your project to use it. -- Configure the top-level `parserOptions` property like this: +```tsx +import { + GridStackProvider, + GridStackRender, + GridStackRenderProvider, +} from "path/to/lib"; +import "gridstack/dist/gridstack.css"; +import "gridstack/dist/gridstack-extra.css"; +import "path/to/demo.css"; -```js -export default tseslint.config({ - languageOptions: { - // other options... - parserOptions: { - project: ['./tsconfig.node.json', './tsconfig.app.json'], - tsconfigRootDir: import.meta.dirname, +function Text({ content }: { content: string }) { + return