flowplayer / react-flowplayer

Flowplayer React Component
MIT License
2 stars 4 forks source link

Refactor/untangle hook #32

Closed rashadatjou closed 2 years ago

rashadatjou commented 2 years ago

Why this PR was created I was not able to get the Flowplayer component to render properly and had rendering issues.

What is this PR does This PR's main purpose is to improve performance. The previous architecture caused the Flowplayer (component) not to render or to render after a delay as it was waiting for the useFlowplayer hook to finishes processing. By separating the component and the hook a much cleaner and intuitive API is the result. The component can render instantly and we do not lose rendering performance this way + the hook does not need to execute when users just want to use the Flowplayer Component by itself.

Question: Do we need to export the Flowplayer component props so that the IDE can have autocomplete? (VSCode autocomplete does not work with current setup)

nnarhinen commented 2 years ago

I think this is ok, but we need to bump the version properly. It can't be a patch release because it's changing the outwards facing API. So it needs to be at least a minor release to mark it's not backwards compatible.