Code submission for FLIP fest 'Playground: Fix client-side errors in the playground frontend #58' - Milestone 0.5 #167
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes: #163 #164 #165 #166
Description
The Examples.tsx component had unnecessarily been including a 'key' prop in components nested inside of the main component that was being created by the map function. I believe one 'key' prop applied to the main component is sufficient.
The series of Redirects from reach router used in the project provider caused a cascade of errors as described in the four bug issues that I submitted. I'm currently investigating how this can be optimized. For now, the use of 'noThrow' in reach router suppresses the errors in the console. As explained in the reach router docs for the 'Redirect' feature:
"""
Redirect works with componentDidCatch to prevent the tree from rendering and starts over with a new location.
Because React doesn’t swallow the error this might bother you. For example, a redirect will trigger Create React App’s error overlay. In production, everything is fine. If it bothers you, add noThrow and Redirect will do redirect without using componentDidCatch.
If you’re using React < 16 Redirect will not throw at all, regardless of what value you put for this prop.
"""
For contributor use:
Files changed
in the Github PR explorer