Components: refactor ColorPalette to disable exhaustive-deps check for now#41253
Components: refactor ColorPalette to disable exhaustive-deps check for now#41253
ColorPalette to disable exhaustive-deps check for now#41253Conversation
isSelectedCustom() in useCallback to ensure re…ColorPalette to pass exhaustive-deps
|
Size Change: 0 B Total Size: 1.24 MB ℹ️ View Unchanged
|
|
Added @geriux too in order to have a reviewer with more experience on React native (in case) |
ciampo
left a comment
There was a problem hiding this comment.
Code changes LGTM, but as I said previously, I'd prefer if the approval was given by someone more confident with React native (and its testing/building processes)
cf25a13 to
7a5f206
Compare
Good catch! Weird that the linter didn't catch it though |
9564af3 to
b37de51
Compare
|
@geriux would you be able to take another look? Thank you! |
|
Thanks for updating the code! I've tested again and I found another issue with the We can keep the This is the issue we have with the ColorPalette.mov |
|
Thank you @geriux for taking another look!
This is usually a code smell, hinting that the code could be rewritten differently. I looked into the code a bit more, and noticed that the If we have to disable What do folks think? |
Definitely, adding more things to the dependencies list might cause other side effects not expected when this component was created. And I agree that it would need to be refactored a so it works correctly.
I like that suggestion, until we have some time to check that component and make the necessary code changes. I'm actually happy we are planning to add the |
|
Sounds like trying to get this one safely passing |
b37de51 to
da92d8f
Compare
ColorPalette to pass exhaustive-deps ColorPalette to disable exhaustive-deps check for now
+1 to that! Thank you! |
da92d8f to
87f6779
Compare

What?
Updates the
ColorPalettecomponent to satisfy theexhaustive-depseslint ruleWhy?
Part of the effort in #41166 to apply
exhuastive-depsto the Components packageHow?
isSelectedCustomto theuseEffectdependency arrayisSelectedCustominuseCallbackto allow for a stable reference between renders, rather than having the function get redeclared each time.Testing Instructions
exhaustive-depseslint rule #41166, OR manually set'react-hooks/color-palette': 'warn'in your local eslint filenpx eslint packages/components/src/color-palette