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

Fix cook recipe modal container's local state to update after an edit #4

Open
wants to merge 2 commits into
base: full-build
Choose a base branch
from

Conversation

Shaderpixel
Copy link

Issue: A recipe's ingredients or instructions in the cook recipe modal do not reflect new edits when viewing it after saving edits. It only updates the cook recipe modal's local state after opening and closing it and the new changes will appear.

Fix: Use the getDerivedStateFromProps lifecycle method to do a simple array toString string comparison of props with local state values.

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