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

[Feat]: Add react v19 to peer deps #1041

Merged
merged 1 commit into from
Oct 28, 2024
Merged

Conversation

Yonom
Copy link
Contributor

@Yonom Yonom commented Oct 22, 2024

Thanks a lot for this package

I get the following warning from pnpm after upgrading to NextJS v15 (released today), which installs react 19 RC

React 19 is technically still in RC stage, but since a stable version of a major Metaframework is installing it, it's a sign that it's ready for production use and will now be used by many projects.

└─┬ embla-carousel-react 8.3.0
  └──  unmet peer react@"^16.8.0 || ^17.0.1 || ^18.0.0": found 19.0.0-rc-65a56d0e-20241020

@davidjerleke
Copy link
Owner

davidjerleke commented Oct 23, 2024

Thank you for your contribution @Yonom, much appreciated 👍.

I have one question

I haven't checked out React 19 so I don't know if it has any breaking changes that will affect/break the useEmblaCarousel hook. Will it be compatible without any changes?

@davidjerleke davidjerleke added the feature request New feature or request label Oct 23, 2024
@davidjerleke davidjerleke changed the title feat: add react v19 to peer deps [Feat]: Add react v19 to peer deps Oct 23, 2024
@davidjerleke davidjerleke added the react Issue is related to React label Oct 23, 2024
@Yonom
Copy link
Contributor Author

Yonom commented Oct 23, 2024

I couldn't spot any issues in my installation of it!

@ricardo-a-alves-alb
Copy link

By looking at the official upgrade guide, the only thing that seems to "apply" to this codebase is the useRef part, which already is implemented this way on useEmblaCarousel hook.

@davidjerleke
Copy link
Owner

@ricardo-a-alves-alb do you mean that the useRef code in useEmblaCarousel will work with React 19 as is or that it needs to change?

@ricardo-a-alves-alb
Copy link

@ricardo-a-alves-alb do you mean that the useRef code in useEmblaCarousel will work with React 19 as is or that it needs to change?

As-is, it should work properly. The difference from 18 to 19 is that useRef() does not allow no arguments passed. Since useEmblaCarousel always passes a default value to useRef(), it should work with no issues.

@davidjerleke
Copy link
Owner

@ricardo-a-alves-alb thanks for digging into this. I will merge this soon. @Yonom could you check if this PR needs to be rebased and do that on the latest master in case it’s necessary?

@davidjerleke
Copy link
Owner

Thanks @Yonom for your contribution and @ricardo-a-alves-alb for the reference 👍.

@davidjerleke davidjerleke merged commit 76aacbc into davidjerleke:master Oct 28, 2024
davidjerleke added a commit that referenced this pull request Oct 28, 2024
@Yonom Yonom deleted the react-19 branch October 28, 2024 19:57
@davidjerleke davidjerleke added the resolved This issue is resolved label Oct 29, 2024
@davidjerleke
Copy link
Owner

@Yonom and @ricardo-a-alves-alb I just released this in v8.3.1.

@ricardo-a-alves-alb
Copy link

@Yonom and @ricardo-a-alves-alb I just released this in v8.3.1.

Nice! One more dependency updated so I can upgrade to Next.js 15 later on 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request react Issue is related to React resolved This issue is resolved
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants