Stats: why do you need to pass all the props
Hello,
- As a developer I'm wondering why all these props are need to be passed
Statscomponent:
IMO all these props should already be present in the player and be accessible via state, context API, recoil, osv and should not be passed to the component to prevent the player and stats to be not in sync.
- IMO
apiis confusing name for the prop also and IMO you should have comments above the props types in order to display hints in VS Code and help the developers to understand what the prop does, e.g.:,
True, currently everything is passed as props down to each component. Now that this has grown it might be a good idea to combine player state into a context, and use that within the major components such as PlaybackArea, Stats, Controls. If you implement your own Player, it's then up to you to provide the same context. Lower-level components should probably keep the props (and not depend on the context).
At first glance, some things that could end up in a context would be:
{
play, setPlay,
refresh, setRefresh,
host, setHost,
api, setApi,
parameters, setParameters,
volume, setVolume,
videoProperties, setVideoProperties
}
All valid concerns. We'll take a look at this.