diff --git a/examples/starter/README.md b/examples/starter/README.md new file mode 100644 index 0000000000..a42fc02983 --- /dev/null +++ b/examples/starter/README.md @@ -0,0 +1,20 @@ +# Starter [![Open in StackBlitz](https://img.shields.io/badge/Open%20in-StackBlitz-blue?style=flat-square&logo=stackblitz)](https://stackblitz.com/github/pmndrs/zustand/tree/main/examples/starter) + +## Set up locally + +```bash +git clone https://github.com/pmndrs/zustand + +# install project dependencies & build the library +cd zustand && pnpm install + +# move to the examples folder & install dependencies +cd examples/starter && pnpm install + +# start the dev server +pnpm dev +``` + +## Set up on `StackBlitz` + +Link: https://stackblitz.com/github/pmndrs/zustand/tree/main/examples/starter diff --git a/examples/starter/index.html b/examples/starter/index.html index 6ae2cc048d..91f9ad212f 100644 --- a/examples/starter/index.html +++ b/examples/starter/index.html @@ -9,7 +9,7 @@ -
- +
+ diff --git a/examples/starter/src/index.css b/examples/starter/src/index.css index 1b171ee7ff..97f9fe3605 100644 --- a/examples/starter/src/index.css +++ b/examples/starter/src/index.css @@ -1,10 +1,10 @@ html, body, -#app { +#root { height: 100%; } -#app { +#root { display: flex; place-items: center; justify-content: center; diff --git a/examples/starter/src/app.tsx b/examples/starter/src/index.tsx similarity index 94% rename from examples/starter/src/app.tsx rename to examples/starter/src/index.tsx index 691fd05d87..677ebed926 100644 --- a/examples/starter/src/app.tsx +++ b/examples/starter/src/index.tsx @@ -51,9 +51,7 @@ function App() { ); } -const root = document.getElementById('app'); - -createRoot(root!).render( +createRoot(document.getElementById('root')!).render( ,