[v11] remove not needed dependency, remove not needed warning#2153
Merged
[v11] remove not needed dependency, remove not needed warning#2153
Conversation
|
… fix some components throwing ref warnings under React 18
561cf35 to
0e9a47d
Compare
matyasf
commented
Sep 24, 2025
Comment on lines
32
to
41
| function getElementRef(elem: { ref?: any; props?: { ref: any } }) { | ||
| if (elem?.props?.ref !== undefined) { | ||
| return elem.props.ref | ||
| // Note that this is added by InstUI components like Position | ||
| if (elem.ref) { | ||
| return elem.ref | ||
| } | ||
| return elem.ref | ||
| // note that trying to access this will display a warning in React 18. | ||
| // this is OK because without it React itself would show an error because | ||
| // its using findDOMNode | ||
| return elem?.props?.ref | ||
| } |
Collaborator
Author
There was a problem hiding this comment.
This is the main change. The issue was that BreadCrumb example was showing "ContextView: ref is not a prop" warnings with React 18
joyenjoyer
approved these changes
Sep 24, 2025
balzss
approved these changes
Sep 24, 2025
Contributor
balzss
left a comment
There was a problem hiding this comment.
the code looks good. if I run the docs locally, i get this error when navigating to http://localhost:9090/#View , might be something that was already there...
Collaborator
Author
yes, we have this in v10 too |
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.
instructure/theme-registrydependencies were still there, this package was removedelem?.props?.refafter it has triedelem.refbecause accessingelem?.props?.reftriggers a warning@testing-library/reactto test: check things that display a popup that they work well and there are no console errors/warnings.