I'm using styled-components to build a message card component. I'm trying to make it have as little logic and take as few props as possible, so I'm using CSS to style any <p>
or <svg>
elements that are passed in as children like so:
I'm also using typescript and I'd like to ensure that the only element types passed in as children are a minimum of 1 paragraph element and 1 SVG element?
Something like this for example:
type = MessageCardProps = {
children: [ JSXSVGElement?, JSXParagraphElement, JSXParagraphElement]
}