-
Notifications
You must be signed in to change notification settings - Fork 0
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
GC-1083 - Fix console log spam in item editor #1220
GC-1083 - Fix console log spam in item editor #1220
Conversation
… and `toggleShowContent` to the dom
lib/Dropdown/DropdownAction.js
Outdated
showContent: showContentProp, | ||
toggleShowContent: toggleShowContentProp, | ||
...restProps | ||
} = props; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same q for the one below, why are we destructuring again here rather than in the main props destructuring above?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in this case there was a naming collision when I tried to destructing in the function arguments directly with the destructuring that happens on the DropdownContext below.
I guess i could rename the values in the component props when destructuring like this but it didn't feel right somehow
...
value,
showContent: showContentProp,
toggleShowContent: toggleShowContentProp,
...props
}) => {
const {
toggleShowContent = toggleShowContentProp,
showContent = showContentProp
} = useContext(DropdownContext) || {};
...
I guess my actual issue is refactoring this bit to prevent the collision:
const {
toggleShowContent = toggleShowContentProp,
showContent = showContentProp
} = useContext(DropdownContext) || {};
I'll have a rethink - think it was my late afternoon brain failing me on this one
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, the other issue was alongside the naming issue, we are also setting default values so that is the dropdown context returns nothing, we default to the values from the props - that tripped up my other attempts too
💬 Description
Fixing some issues that are causing spammy console logs and actual issues potentially getting missed
#BrokenWindows