fix(positioning-portal): replace findDOMNode with ref #40
+22
−18
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.
This pull request refactors the
PositioningPortalcomponent to improve how it references its parent DOM node. Instead of usingReactDOM.findDOMNode, which is discouraged in modern React, it now uses arefattached directly to a wrappingdiv. This change is implemented across the TypeScript source, the compiled JavaScript, and the legacy build.Component refactoring:
ReactDOM.findDOMNode(this)withthis.parentRef.currentto reference the parent DOM node, and introduced a newparentRefusingReact.createRef. This makes the code more robust and future-proof, asfindDOMNodeis deprecated in React's strict mode. (src/components/PositioningPortal.tsx,lib/index.js,lib/legacy/index.js/index.js) [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]Build and documentation updates:
docs/iframe.html,docs/project.json) [1] [2]@webholics this should address the issue with deprecated findDOMNode without having to upgrade to react-19, do you think is it possible to integrate? I've tested the changes with storybook and everything looks fine