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

Use hooks, support React 18, drop React <16 #117

Open
wants to merge 74 commits into
base: default
Choose a base branch
from
Open

Conversation

goto-bus-stop
Copy link
Member

@goto-bus-stop goto-bus-stop commented Jun 30, 2021

npm install @u-wave/react-youtube@next

This will be version 1.0 of the library. It uses hooks internally instead of a class. It exposes a useYouTube hook so you can attach a player to an element that way. <YouTube /> is a very boring wrapper around that hook. The hook also provides easier access to the player instance.

Breaking changes

  • The package now requires React 16 or later.
  • The package targets modern browsers, it uses ES2015 syntax. Transpile it if you need broader support.
  • showInfo and suggestedQuality props are removed: these were already removed from the YouTube API a few years ago and have had no effect ever since.

Otherwise the API remained exactly the same.

Todo

  • Need to make sure the unmount order with the hook API is right, as the YT SDK has some strict expectations about that.

@goto-bus-stop goto-bus-stop changed the title rewrite it with hooks Use hooks, support React 18, drop React ≤16 Dec 18, 2021
@goto-bus-stop goto-bus-stop changed the title Use hooks, support React 18, drop React ≤16 Use hooks, support React 18, drop React <16 Nov 13, 2022
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

Successfully merging this pull request may close these issues.

1 participant