preact-compat icon indicating copy to clipboard operation
preact-compat copied to clipboard

react-visibility-sensor: this.setState is not a function

Open screendriver opened this issue 7 years ago • 3 comments

I want to use react-visibility-sensor but unfortunately I get this error:

6af69881-d748-496f-88d2-f29139f5a98a

@developit do you know what's going on here? I get this message in a loop endless times 🤔

screendriver avatar Aug 22 '17 10:08 screendriver

seems like an issue with create-react-class. can you try aliasing that to preact-compat/lib/create-react-class?

developit avatar Sep 28 '17 21:09 developit

This bug was happening for me as well–I added

create-react-class: 'preact-compat/lib/create-react-class' to my alias file, and this error went away. Thank you Jason and Christian! 🙇

* thanks for finding the typo @tiagojsalmeida !

david-trejo-ck avatar Apr 23 '18 23:04 david-trejo-ck

For future reference, the alias is create-react-class, not react-create-class

"create-react-class": "preact-compat/lib/create-react-class",

tiagojsalmeida avatar Jul 09 '18 16:07 tiagojsalmeida