Skip to content
Myr

App.jsx

This file

Path

examples/demo/src/App.jsx

36 lines · 766 bytes · JavaScript

Last changed by

Not known.

History of this file

Take it

The walk stopped after 200 commits: lines older than f85898f point at it.

chore(eslint.config.mjs): update 'eslint-plugin-react-hooks', 'eslint-plugin-react-compiler' config (#3043)Wonsuk Choibefore adoptionf85898f

lines 1–36why, one step back
1import { create } from 'zustand'
2import CodePreview from './components/CodePreview'3import Details from './components/Details'4import Scene from './components/Scene'56const useStore = create((set) => ({7 count: 1,8 inc: () => set((state) => ({ count: state.count + 1 })),9}))1011function Counter() {12 const { count, inc } = useStore()13 return (14 <div className="counter">15 <span>{count}</span>16 <button onClick={inc}>one up</button>17 </div>18 )19}2021export default function App() {22 return (23 <>24 <Scene />25 <div className="main">26 <div className="code">27 <div className="code-container">28 <CodePreview />29 <Counter />30 </div>31 </div>32 <Details />33 </div>34 </>35 )36}