Skip to content

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

Open
Shaderpixel wants to merge 2 commits into
dequelabs:full-buildfrom
Shaderpixel:full-build-fix
Open

Fix cook recipe modal container's local state to update after an edit#4
Shaderpixel wants to merge 2 commits into
dequelabs:full-buildfrom
Shaderpixel:full-build-fix

Conversation

@Shaderpixel

Copy link
Copy Markdown

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