Comments (10)
Unsubscribing listeners didn’t do the trick for me. I actually removed them altogether and still get the warning in my tests, and occasionally in the browser.
from react-flickity-component.
This error occurred to me when I didn't cleanup a listener after unmount. The fix is to unbind any events you're registering on unmount.
React.useEffect(() => {
const listener = () => {
const text = flkty.current.selectedElement.getAttribute('data-caption');
setCaption(text);
};
flkty.current.on('select', listener);
return () => flkty.current.off('select', listener);
}, []);
from react-flickity-component.
Im also having this issue
from react-flickity-component.
Can you create a reduced test case in codesandbox?
from react-flickity-component.
It's still happening. You can check it using your own demo:
See:
https://codesandbox.io/s/qlz12m4oj6
Just change the library version from 3.2.0 to 3.4.0. And check the (chrome) console.
https://codesandbox.io/s/react-flickity-94qi9
Apparently, it's working with 3.3.2, so I'll stick to it.
from react-flickity-component.
Has anyone been able to fix this?
from react-flickity-component.
Have you try the latest version? you need to install flickty as peer dependency
from react-flickity-component.
@nullhook ah! I didn't consider that because I was using the on
attribute as part of Flickity options, so I've reconfigured it and I don't seem to be getting the error anymore. Thank you.
from react-flickity-component.
I am not sure why this case is closed... I am still running into the same issue even though I am cleaning up the listener in my useEffect after unmounting. Any suggestions on how to troubleshoot?
from react-flickity-component.
ensure you're component is properly unmounted - try logging from the unmount function and see if it triggers on unmount. also, it depends on how you're defining flickityRef
- ensure the local reference to the Flickity
component isn't null.
from react-flickity-component.
Related Issues (20)
- 'Module not found, can't resolve 'flickity' with CRA HOT 1
- Flickity-extensions support (hash/fullscreen/etc) HOT 5
- Using with flickity-as-nav-for - Typescript HOT 3
- prev/next arrow size problem in firefox browser HOT 1
- npm ERR! Could not resolve dependency: npm ERR! peer react@"^16.14.0" from [email protected] HOT 7
- Force reload HOT 1
- Option "pauseAutoPlayOnHover" missing.
- Doesn't work well on Safari iOS 15 HOT 2
- Please i've been having issue using the flickityRef, i can't wrap my head around it HOT 1
- Storybook HOT 1
- after updating to flickity 3.0 carousel started to display slides one on top of the other HOT 1
- Updating flickity peerDependency and devDependency to 3.0.0 HOT 1
- Updating peer dependencies to support React v. 18 HOT 20
- Error children with typescript HOT 2
- [V4] ReferenceError: window is not defined HOT 4
- v4 does not include TypeScript type definitions HOT 1
- Is it possible to configure flickity to only show x amount of slides?
- reloadOnUpdate behaviour is not intuitive HOT 2
- warning " > [email protected]" has unmet peer dependency "flickity@^2.2.1".
- typescript import HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-flickity-component.