Skip to content
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

findDOMNode will be deprecated #141

Open
dsempel opened this issue Oct 25, 2018 · 21 comments
Open

findDOMNode will be deprecated #141

dsempel opened this issue Oct 25, 2018 · 21 comments

Comments

@dsempel
Copy link

dsempel commented Oct 25, 2018

Starting from React 16.6 it is deprecated in StrictMode and it will be deprecated from React in the future. Here is some more information about this.

The docs state the following:

Normally you don’t need this because you can attach a ref directly to a DOM node.

However, reading through the source code I see that VisibilitySensor is not rendering any DOM nodes itself, so I'm not sure what would be the best way to attach the ref.

The warning in StrictMode:

Warning: findDOMNode is deprecated in StrictMode. findDOMNode was passed an instance of VisibilitySensor which is inside StrictMode. Instead, add a ref directly to the element you want to reference.

@joshwnj
Copy link
Owner

joshwnj commented Oct 25, 2018

Thanks for the heads up @dsempel ! Will have a think about this one

@donperi
Copy link

donperi commented Nov 3, 2018

@joshwnj Hope the above PR works for you.

@tanyaburlakova
Copy link

@joshwnj hey!

Can you please help me, I updated my app with webpack 4 and babel 7 and react-visibility-sensor is stooped working. Do you have any idea why?

Thanks!

@dancrew32
Copy link

dancrew32 commented Jan 24, 2019

Hey gang, any chance this will hit master? Thanks!
RE: #142

@RoninSTi
Copy link

Any updates on #142 being merged?

@alizahir23
Copy link

hey can #142 please be merged into master if its working

@nigellima
Copy link

Hello. Any changes this PR will be merged #142? The warning is still present once the component is used

@nick-0101
Copy link

nick-0101 commented Dec 19, 2020

Any reasons why #142 has not been merged yet?

Issue #179 is right. This project is dead, no use waiting on something that wont be merged.

@johnbonds
Copy link

+1 on merging this please!

@nigellima
Copy link

+1 on merging this, please.

@ComradeLV
Copy link

+1 on merging, please!

@Vir-al
Copy link

Vir-al commented Mar 4, 2021

+1 on merging #142, please!

@sajadko
Copy link

sajadko commented Mar 13, 2021

+1 on merging, please!

@ZengLawrence
Copy link

+1 on merging #142, please!

@slavagoreev
Copy link

slavagoreev commented Aug 10, 2021

Seems that this issue is stalling for ever

Temporal solution for you guys:

if (appSettings.isDevelopment) {
  const backup = console.error;

  console.error = function filterWarnings(msg) {
    const supressedWarnings = ['Learn more about using refs'];

    if (!supressedWarnings.some((entry) => msg.includes(entry))) {
      backup.apply(console, arguments);
    }
  };
}

@Seybo
Copy link

Seybo commented Aug 28, 2022

+1 on merging, please!

@myadzel
Copy link

myadzel commented Jan 10, 2023

+1 on merging #142, please!

@ThomasDEVio
Copy link

Merge it!!!

@ahmadalfy
Copy link

2023, requesting a merge

@nathggns
Copy link

nathggns commented Nov 2, 2023

Has anyone forked this project? It's not maintained anymore, so seems sensible to consider forking it to solve this particular problem.

@ahmadalfy
Copy link

Has anyone forked this project? It's not maintained anymore, so seems sensible to consider forking it to solve this particular problem.

I replaced it with react-waypoint. It's almost a drop-in replacement

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests