-
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
base: master
Are you sure you want to change the base?
Conversation
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
@@ -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:
***@***.***>
|
We are still looking into other ways to resolve this issue, so feel free to give us your insight here. |
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
.