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

UNSAFE_componentWillReceiveProps in strict mode is not recommended and may indicate bugs in your code. | Please update the following components: ReactOwlCarousel #111

Open
AlirezaGhadyani opened this issue Dec 17, 2021 · 9 comments

Comments

@AlirezaGhadyani
Copy link

im using the 2.3.3v and i have this issue

index.js:1 Warning: Using UNSAFE_componentWillReceiveProps in strict mode is not recommended and may indicate bugs in your code. See https://reactjs.org/link/unsafe-component-lifecycles for details.

  • Move data fetching code or side effects to componentDidUpdate.
  • If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://reactjs.org/link/derived-state

Please update the following components: ReactOwlCarousel
Capture

@ThomasSalty
Copy link

I have the exact same error.
The app is working fine, Owl Carousel is working fine except for this error message in the console:

react-dom.development.js:67 Warning: Using UNSAFE_componentWillReceiveProps in strict mode is not recommended and may indicate bugs in your code. See https://reactjs.org/link/unsafe-component-lifecycles for details.

  • Move data fetching code or side effects to componentDidUpdate.
  • If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://reactjs.org/link/derived-state

Please update the following components: ReactOwlCarousel

@laurenchen0631
This is the same as Issue 110 which was opened on 29 Nov 2021.
Should we expect a fix for this in one of the next releases?

@td-cristian-torrado
Copy link

Hi Guys here i have the seme issue. Please update the way that you manage the state. Any plan for this update ?

@rayhanmujumdar
Copy link

how to fixed this warning anybody can help?

@grzegorz-muszynski
Copy link

Hi. I found "UNSAFE_componentWillReceiveProps" only in react-owl-carousel/src/OwlCarousel.tsx.
It seems to be used in lines 32-34...

    public UNSAFE_componentWillReceiveProps() {
        this.destory();
    }

...and 80-84:

    public destory() {
        if (!this.$ele) throw new Error('OwlCarousel is not created');

        this.$ele.trigger('destroy.owl.carousel');
    }

Is this necessary? Seems like those lines were useless. Maybe if it will be removed or replaced correctly, an error message will disappear. Can anybody help?

@Milind-P
Copy link

Milind-P commented Mar 7, 2023

Is there a fix to this yet?

@Milind-P
Copy link

Milind-P commented Mar 7, 2023

I am using react-owl-carousel-dotlab. They don't have this issue and there is no need to update the code, just install this package and import it.

@ktm72
Copy link

ktm72 commented Jun 7, 2023

I am using react-owl-carousel-dotlab. They don't have this issue and there is no need to update the code, just install this package and import it.

Page Not Found....

@numaanjaved
Copy link

I am having the same issue right now

1 similar comment
@sirajulgit
Copy link

I am having the same issue right now

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

9 participants