-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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 prop-drilling in IDEView
#2054
Fix prop-drilling in IDEView
#2054
Conversation
# Conflicts: # client/modules/IDE/pages/IDEView.jsx
…factor/props-drilling # Conflicts: # client/modules/IDE/components/Editor.jsx # client/modules/IDE/components/Feedback.jsx
Just a quick check-in: I did end up refactoring the tests to work with new propsless/connected design. There are still two tests which fail with regards to handling non-numeric inputs on the text size input. I changed this from an input with type “text” to type “number” which means that there is some automatic validation by the DOM. So I don’t think there is any actual problem, as you cannot type letters into the input. But it does cause the tests to fail 🤷🏻♀️ |
Thanks for your update on this! Hmm, that makes sense to me! I'll also think on this on my end and will update you with any thoughts! |
I'm going to close this as I have re-submitted most of the changes in individual PRs. Reminder to myself -- I still need to revisit changing the font size input to
|
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 componentIDEOverlays
, as suggested here. This new component is connected to the redux store which means that more prop drilling goes away, as theIDEView
no longer needs to deal with theisVisible
andclose
logic for the modals and overlays.I have verified that this pull request:
npm run lint
)npm run test
)develop
branch.Fixes #123