-
Notifications
You must be signed in to change notification settings - Fork 136
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 deprecated findDOMNode usage in React 19 #909
Open
jtwite
wants to merge
5
commits into
naver:master
Choose a base branch
from
jtwite:fix-react-19-findDOMNode
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains 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
Update the library to remove the use of deprecated `findDOMNode` and replace it with a ref-based approach. * **NonStrictPanel.tsx** - Replace `findDOMNode` with `React.createRef` to access the DOM element. - Update the `nativeElement` getter to return the current ref. - Modify the `render` method to clone the element with the ref. * **ReactElementProvider.ts** - Update the constructor to accept a ref instead of a `StrictPanel` or `NonStrictPanel`. - Update the `element` getter to return the current ref. - Modify the `show` and `hide` methods to use the ref. * **Flicking.tsx** - Remove the `useFindDOMNode` prop and use a ref-based approach. - Update the `_createPanelRefs` method to use `React.createRef`. - Update the `_getPanels` method to use the new ref-based approach. * **ReactRenderer.ts** - Update the `_collectPanels` method to use the new ref-based approach. - Update the `_createPanel` method to use the new ref-based approach. * **package-lock.json** - Update the version to `4.12.0-snapshot`.
* Add `nativeElement` getter to return the current ref * Update `ReactElementProvider.ts` constructor to accept a ref instead of a `StrictPanel` or `NonStrictPanel` * Update `element` getter to return the current ref * Replace `useFindDOMNode` prop with a ref-based approach in `Flicking.tsx` * Update `_createPanelRefs` method to use `React.createRef` * Update `_getPanels` method to use the new ref-based approach * Update `_collectPanels` method in `ReactRenderer.ts` to use the new ref-based approach * Update `_createPanel` method to use the new ref-based approach
malangfox
reviewed
Feb 18, 2025
@@ -47,7 +47,7 @@ | |||
}, | |||
"repository": { | |||
"type": "git", | |||
"url": "https://github.com/naver/egjs-flicking" | |||
"url": "https://github.com/jtwite/egjs-flicking" |
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.
Hello @jtwite. Thank you for your contribution.
Could you restore package.json and gitignore before merging it into our main branch?
Definitely!
…On Tue, Feb 18, 2025 at 12:16 AM malangfox ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In package.json
<#909 (comment)>:
> @@ -47,7 +47,7 @@
},
"repository": {
"type": "git",
- "url": "https://github.com/naver/egjs-flicking"
+ "url": "https://github.com/jtwite/egjs-flicking"
Hello @jtwite <https://github.com/jtwite>. Thank you for your
contribution.
Could you restore package.json and gitignore before merging it into our
main branch?
—
Reply to this email directly, view it on GitHub
<#909 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADHYXVKYA3KSTVHF6BVBJDL2QLF3FAVCNFSM6AAAAABWO7PMHSVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDMMBXHE3TEMRQHA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
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.
Update the library to remove the use of deprecated
findDOMNode
and replace it with a ref-based approach.NonStrictPanel.tsx
findDOMNode
withReact.createRef
to access the DOM element.nativeElement
getter to return the current ref.render
method to clone the element with the ref.ReactElementProvider.ts
StrictPanel
orNonStrictPanel
.element
getter to return the current ref.show
andhide
methods to use the ref.Flicking.tsx
useFindDOMNode
prop and use a ref-based approach._createPanelRefs
method to useReact.createRef
._getPanels
method to use the new ref-based approach.ReactRenderer.ts
_collectPanels
method to use the new ref-based approach._createPanel
method to use the new ref-based approach.package-lock.json
4.12.0-snapshot
.