Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/haskell/8.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
Haskell中'React.createClass'的类型是什么?_Haskell_Reactjs - Fatal编程技术网

Haskell中'React.createClass'的类型是什么?

Haskell中'React.createClass'的类型是什么?,haskell,reactjs,Haskell,Reactjs,我正在阅读,我想知道Haskell中的React.createClass/ReactClass和ReactComponent是什么类型 我试图理解React中的概念,因此提出了这个问题 我的猜测是: type ReactClass=(TProps)=>ReactComponent 将转换为Haskell,如: data-ReactClass-tprops=data-ReactClass(tprops->ReactComponent-tprops) 及 类型组件={ 道具:TProps, rend

我正在阅读,我想知道Haskell中的
React.createClass
/
ReactClass
ReactComponent
是什么类型

我试图理解React中的概念,因此提出了这个问题

我的猜测是:

type ReactClass=(TProps)=>ReactComponent

将转换为Haskell,如:

data-ReactClass-tprops=data-ReactClass(tprops->ReactComponent-tprops)

类型组件={
道具:TProps,
render:()=>ReactElement
};
这将转化为Haskell:

data ReactComponent tProps=ReactComponent tProps ReactElement

但我不确定


如果这是错误的,请有人纠正我好吗?

您可能会从purescript获得灵感。它们有一个为react编写的绑定。在翻译函数类型时,您忘记了
这个
<代码>此
提供对状态、道具和参考的访问。嗯。。。好的,谢谢,那会去哪里?这是PS绑定:
type ReactComponent<TProps> = {
  props : TProps,
  render : () => ReactElement
};