TypeScript error skipping into styled components
I'm having a hard time solving this TypeScript problem.
...message: 'Type '{ show: boolean; children: Element; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<Component<ThemedOuterStyledProps<HTMLProps<HTMLDiv...'.
Property 'show' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<Component<ThemedOuterStyledProps<HTMLProps<HTMLDiv...'.'
I am using React ++ w871 components. If I have a style like this:
const Component = styled.div`
opacity: ${props => props.show ? 1 : 0}
`
and my React component looks like this:
const ReactComponent = (props: { appLoading: boolean }) => (
<Component show={appLoading} />
)
I'm new to TypeScript, but I'm guessing I somehow need to define show support on Component?
+3
source to share