p5.js-web-editor
p5.js-web-editor copied to clipboard
Fix prop-drilling in `IDEView`
This is a draft because the unit tests for <Preferences/> need to be updated.
Fixes #824 Fixes #2053 Continues work on #1458 Expands on some of my previous PRs.
Changes:
Props Drilling
I handled the following components:
PreferencesSidebarShareModal
The IDEView no longer passes down any props to these components. They now take no props and access everything via react-redux hooks. I converted all three from class to function components.
Code Breakup
I moved all of the overlays from IDEView to a new component IDEOverlays, as suggested here. This new component is connected to the redux store which means that more prop drilling goes away, as the IDEView no longer needs to deal with the isVisible and close logic for the modals and overlays.
I have verified that this pull request:
- [x] has no linting errors (
npm run lint) - [ ] has no test errors (
npm run test) - [x] is from a uniquely-named feature branch and is up to date with the
developbranch. - [x] is descriptively named and links to an issue number, i.e.
Fixes #123