Pomax / react-onclickoutside

An onClickOutside wrapper for React components

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

findDOMNode is deprecated in React StrictMode

Ruslan101 opened this issue · comments

I used the react-onclickoutside (6.12.0) and I got this warning from React:

Warning: findDOMNode is deprecated in StrictMode. findDOMNode was passed an instance of AddExtModal which is inside StrictMode. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-find-node
at onClickOutside (http://mySiteName/static/js/vendors~main.chunk.js:77178:26)

This seems not very clean and easy to fix. Any solution is going to involve merging refs, if I'm not mistaken. Not impossible, but it's not gonna be pretty.

commented

Given the advances in JS, particularly the contains function, there might finally be a simple solution here, since we only need the HoC's own ref to determine whether clicks are inside or outside of the local DOM tree. I'll see if I have some time soon to pen a revision.

Any update on this issue :) ?

commented

If you're using hooks: yes. If you're using component classes, not yet.

No time estimate on when it'll get done either, but if you want to pay for the time necessary to fix this, feel free to reach out and I can move this up to the top of the queue to get it done in the next few days.

What amount of funding might you need to resolve this? @Pomax

commented

Uplifting dependencies and testing for v17, updating the code and writing additional test, updating the docs, and "not spending time on the things that were on the top of the to-do list" would probably put it at around $1000 (which I fully realise is well beyond the donation budget of an individual, but is a trivial one-time expense for a company that relies on open source)