Skip to content

Commit

Permalink
simplify example
Browse files Browse the repository at this point in the history
  • Loading branch information
dai-shi committed May 31, 2024
1 parent 182ac8d commit 5bc58b0
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions examples/01_counter/src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ const derived = derive({ double: (get) => get(state).count * 2 });

const Counter = () => {
const snap = useSnapshot(derived);

return (
<>
count: {snap.double} <button onClick={() => ++state.count}>inc</button>
Expand All @@ -15,11 +14,5 @@ const Counter = () => {
};

export default function App() {
return (
<div className="App">
<h1>Hello CodeSandbox</h1>
<h2>Start editing to see some magic happen!</h2>
<Counter />
</div>
);
return <Counter />;
}

0 comments on commit 5bc58b0

Please sign in to comment.