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.
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) O3-4274: Use useRef instead of useState for useVisitFormCallbacks #2157
base: main
Are you sure you want to change the base?
(fix) O3-4274: Use useRef instead of useState for useVisitFormCallbacks #2157
Changes from all commits
ee5f077
e917561
6905952
5db6c90
783de5b
7945ebd
4578546
5740c48
c70c01d
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
I think it is preferable simply to include the ref in the dependency array, even though it will not change.
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.
@Bharath-K-Shetty you actually need to respond to reviewer feedback, you can't just hit the "resolve conversation" button to make things go away
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.
Thank you for the feedback, @brandones ! I understand your concern and have updated the code to include the visitFormCallbacksRef.current in the dependency array of the useEffect hook, even though it is unlikely to change.
But React and ESLint warn against using mutable refs (MutableRefObject) in dependency arrays. This is because changes to .current do not trigger re-renders or effect executions, which can lead to misleading behavior or unnecessary lint suppressions.
For this reason, I’ve previously excluded visitFormCallbacksRef.current from the dependency array
I appreciate your thorough review, and I’ll make sure to properly address all feedback moving forward instead of prematurely resolving conversations. Please let me know if there’s anything else you'd like me to adjust.
Please let me know if you feel strongly about including it, and we can discuss further!
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.
Why did you do this?
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.
Please don't resolve conversations without addressing the question being asked.
Why did you change the extension slot name?
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.
I changed the slot name from visit-form-top-slot to visit-form-bottom-slot because the original name (visit-form-top-slot) was causing a 404 error, indicating that the server could not find the requested resource. After troubleshooting, I updated the name to visit-form-bottom-slot, which resolved the issue and allowed the form to function as intended. This suggests that the visit-form-bottom-slot aligns with the correct configuration or extension setup expected by the system.