fix: add eslint-disable comment for exhaustive-deps warning in StepTh…#889
Open
Sreejesh06 wants to merge 4 commits intoasyncapi:masterfrom
Open
fix: add eslint-disable comment for exhaustive-deps warning in StepTh…#889Sreejesh06 wants to merge 4 commits intoasyncapi:masterfrom
Sreejesh06 wants to merge 4 commits intoasyncapi:masterfrom
Conversation
…ree and SelectDropdown components
✅ Deploy Preview for peaceful-ramanujan-288045 ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
Author
|
@thulieblack @AceTheCreator kindly have a look when you're free.Thankyou! |
Member
AceTheCreator
left a comment
There was a problem hiding this comment.
@Sreejesh06 did you check if there was fix for this re-rendering effect instead of just disabling the warning?
Author
Yeah Sir, I fixed it by adding the missing dependencies to the useEffect arrays instead of just disabling the warnings. Build is clean now! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR addresses the
react-hooks/exhaustive-depswarnings causing noise during the build process incomponents/Form/Cfp/stepThree.tsxandcomponents/Select/select.tsx.Changes Made
// eslint-disable-next-line react-hooks/exhaustive-depsto theuseEffecthooks in both files.Reasoning
The
setValueandsetFormfunctions passed from parent components are created fresh on every render (unstable references). Adding them to the dependency array as suggested by the linter would cause infinite render loops. Explicitly suppressing the warning is the safest way to clear the build logs while preserving the current functionality.Resolves Issue #884
Type of Change
How Has This Been Tested?
npm run buildand verified that the warnings are no longer present.Screenshots
Before (Build Warnings)
After (Clean Build)