【发布时间】:2020-11-19 14:25:27
【问题描述】:
import React, { FunctionComponent } from "react"
import styled from "styled-components"
interface ChildProps {
color: string
}
const Child = styled.div`
background-color: ${(props: ChildProps) => props.color};
`
interface ParentProps {
node: FunctionComponent<ChildProps> // How to set node type to Styled Component `styled.div`?
}
const Parent = function(props: ParentProps) {
const Node = props.node
return <Node color="white" />
}
【问题讨论】:
标签: reactjs typescript styled-components