Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor Fix to todomvc-react Example Project #4580

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions examples/todomvc-react/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "todomvc-react",
"version": "0.0.0",
"version": "0.0.1",
"scripts": {
"dev": "vite",
"build": "tsc && vite build"
},
"dependencies": {
"@xstate/react": "beta",
"@xstate/react": "^4.0.0",
"classnames": "^2.3.2",
"react": "^17.0.2",
"react-dom": "^17.0.2",
Expand Down
24 changes: 14 additions & 10 deletions examples/todomvc-react/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 15 additions & 1 deletion examples/todomvc-react/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,20 @@ This is an implementation of [TodoMVC](https://todomvc.com/) built with:
- TypeScript
- Vite

## [Open in CodeSandbox](https://codesandbox.io/p/sandbox/github/statelyai/xstate/tree/main/examples/todomvc-react)
## How to run

You may run the example locally with:

```shell
cd examples/todomvc-react
pnpm install
pnpm run dev
```

__OR__

[Open in CodeSandbox](https://codesandbox.io/p/sandbox/github/statelyai/xstate/tree/main/examples/todomvc-react)

__OR__

[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/statelyai/xstate/tree/main/examples/todomvc-react)
2 changes: 1 addition & 1 deletion examples/todomvc-react/src/Todos.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export function Todos() {
todosActorRef.subscribe(() => {
localStorage.setItem(
'todos',
JSON.stringify(todosActorRef.getPersistedState?.())
JSON.stringify(todosActorRef.getPersistedSnapshot?.())
);
});
}, [todosActorRef]);
Expand Down