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

apply interface onProgressProps at base.d.ts #1342

Merged
merged 5 commits into from
Jul 15, 2022

Conversation

hyesungoh
Copy link
Contributor

Hello pete, I apply some interface at base.d.ts

  • generate and apply onProgressProps
export interface onProgressProps {
    played: number;
    playedSeconds: number;
    loaded: number;
    loadedSeconds: number;
}

export interface BaseReactPlayerProps {
...
onProgress?: (state: onProgressProps) => void;
...
}

Expected User Behavior

  • using props type for custom onProgress
import ReactPlayer, { onProgressProps } from "react-player";

const foo = () => {
  const onProgress = ({playedSeconds}: onProgressProps) => {
      // something
  }

  return <ReactPlayer url={url} onProgress={onProgress} />
};

@Yasamato
Copy link
Contributor

Yasamato commented Nov 2, 2021

Nice idea! I would only recommend sticking to the existing code styling to prevent merge conflicts...

@hyesungoh
Copy link
Contributor Author

@Yasamato I applied code styling! thank you for letting me know :D

@cookpete
Copy link
Owner

Updated to OnProgressProps (capitalized) to be consistent with other interfaces. Nice work!

@cookpete cookpete merged commit 8eaf997 into cookpete:master Jul 15, 2022
@cookpete
Copy link
Owner

Published in 2.11.0. Sorry for the delay.

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.

3 participants