p5.js-web-editor icon indicating copy to clipboard operation
p5.js-web-editor copied to clipboard

Fix prop-drilling in `IDEView`

Open lindapaiste opened this issue 3 years ago • 0 comments

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:

  • Preferences
  • Sidebar
  • ShareModal

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 develop branch.
  • [x] is descriptively named and links to an issue number, i.e. Fixes #123

lindapaiste avatar Aug 08 '22 00:08 lindapaiste