I'm fairly new to TS and trying to understand how to pass optional props to this component that's a bit complex for me. I thought you could use a ? for the props that you want to be optional, but I'm getting the following error:
A binding pattern parameter cannot be optional in an implementation signature.
How would I pass optional props to this component?
With Optional Props
export const BGVideo = React.memo(function BGVideo({ src, children, bgColor? }: any) {
return ( ^^^^^^^^
<BackgroundVideoContainer>...some other stuff...
)
});
Original
export const BGVideo = React.memo(function BGVideo({ src, children }: any) {
return (
<BackgroundVideoContainer>...some other stuff...
)
});