I was trying to make a function that takes in props and then render a component on button click but for some reason the code wont render any component on click nor there are any errors in the console log here is the code
const App = () => {
const RenderVideoPlayer = (props) => {
let videoSrc = {
type: 'video',
sources: [
{
src: `${props.video_url}`,
type: 'video/mp4',
size: 1080
}
],
poster: '/path/to/poster.jpg',
}
return (
<Plyr
options={options}
source={videoSrc}
/>
)
}
return (
<Button className="s-btn-1" variant="primary" onClick={() => RenderVideoPlayer(movie.video_info[0])}>Watch</Button>
)
I can confirm that it is receiving the props onclick