Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Reactjs 当使用情感反应和打字脚本时,道具和内部道具有什么区别?_Reactjs_Emotion - Fatal编程技术网

Reactjs 当使用情感反应和打字脚本时,道具和内部道具有什么区别?

Reactjs 当使用情感反应和打字脚本时,道具和内部道具有什么区别?,reactjs,emotion,Reactjs,Emotion,我正在尝试将类型添加到我的StyledComponents(情感反应)。 假设我有一个样式化的按钮组件,当我用泛型StyledComponent声明它的类型时,我需要向它传递3个类型变量: const Button : StyledComponent<Props, InnerProps, Theme> = styled("button")` cssProp:cssVal: ` const按钮:StyledComponent= 样式化(“按钮”)`

我正在尝试将类型添加到我的StyledComponents(情感反应)。 假设我有一个样式化的按钮组件,当我用泛型StyledComponent声明它的类型时,我需要向它传递3个类型变量:

const Button : StyledComponent<Props, InnerProps, Theme> = 
    styled("button")`
        cssProp:cssVal:
    `
const按钮:StyledComponent=
样式化(“按钮”)`
cssProp:cssVal:
`
道具和内道具有什么区别?InnerProps仅仅是儿童吗

来自

  • InnerProps
    是表示道具类型的类型参数
  • 内部组件(造型的目标)
  • ExtraProps
    是表示额外道具类型的类型参数
  • 样式化组件

谢谢。我觉得这有点奇怪——我使用组件作为包装器,并将它们作为各种元素的子元素传递。在我编写的代码中,这些包装器对他们可能接收的孩子一无所知。你能分享一个例子吗?