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

feat: Add react example #1

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ChinoUkaegbu
Copy link

@ChinoUkaegbu ChinoUkaegbu commented Oct 20, 2024

Works toward mnfst/manifest#206

Demo:

Demo_Todo_React.mp4

Tagging @brunobuddy

@@ -5,7 +5,7 @@
"scripts": {
"manifest": "node node_modules/manifest/scripts/watch/watch.js",
"manifest:seed": "node node_modules/manifest/dist/manifest/src/seed/scripts/seed.js",
"dev": "concurrently \"npm run manifest\" \"cd examples/angular && npm run dev\""
"dev": "concurrently \"npm run manifest\" \"cd examples/react_ex && npm run dev\""
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe there's some way to choose which example to run instead of manually changing it?

Copy link
Author

@ChinoUkaegbu ChinoUkaegbu Oct 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can probably use useState instead since the tasks aren't that complex...using a reducer seems excessive for this specific use case

import { Item } from "./item";
import classnames from "classnames";

export function Main({ todos, toggleAll, toggleItem, removeItem, updateItem }) {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prop drilling! we're only passing toggleItem, removeItem and updateItem so we can pass it on to our Item component. This can be fixed if we use a ContextProvider I believe

@ChinoUkaegbu
Copy link
Author

The playbackRate error shows even without connecting to the manifest backend so my guess is that it exists in the original todo-mvc repo:

Error_Persists_Even_Without_Manifest.mp4

Also, is there a way to ensure the backend has started first before the frontend starts. When npm run dev is called, the todo list appears empty since manifest starts up after react but once you refresh you can see the existing items

@ChinoUkaegbu ChinoUkaegbu marked this pull request as draft October 20, 2024 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant