Skip to content

Commit

Permalink
fix: format code
Browse files Browse the repository at this point in the history
  • Loading branch information
leweyse committed Dec 28, 2024
1 parent 5aaf263 commit 21366f8
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 18 deletions.
33 changes: 18 additions & 15 deletions examples/starter/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,34 +1,37 @@
import { StrictMode } from 'react';
import { createRoot } from 'react-dom/client';
import { StrictMode } from 'react'
import { createRoot } from 'react-dom/client'
import { create } from 'zustand'

import mascot from './assets/zustand-mascot.svg';
import mascot from './assets/zustand-mascot.svg'

import './index.css';
import './index.css'

type Store = {
count: number;
inc: () => void;
};
count: number
inc: () => void
}

const useStore = create<Store>((set) => ({
count: 0,
inc: () => set((state) => ({ count: state.count + 1 })),
}));
}))

const Counter = () => {
const count = useStore((s) => s.count);
const inc = useStore((s) => s.inc);
const count = useStore((s) => s.count)
const inc = useStore((s) => s.inc)

return (
<>
<span className="text-3xl">{count}</span>
<button className="bg-[#252b37] font-bold py-2 px-4 rounded" onClick={inc}>
<button
className="bg-[#252b37] font-bold py-2 px-4 rounded"
onClick={inc}
>
+1
</button>
</>
);
};
)
}

function App() {
return (
Expand All @@ -48,11 +51,11 @@ function App() {

<Counter />
</div>
);
)
}

createRoot(document.getElementById('root')!).render(
<StrictMode>
<App />
</StrictMode>,
);
)
6 changes: 3 additions & 3 deletions examples/starter/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import react from '@vitejs/plugin-react-swc';
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react-swc'
import { defineConfig } from 'vite'

// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
});
})

0 comments on commit 21366f8

Please sign in to comment.