Syntax 在使用Hooks API时,我们如何别名道具?
以前,我是这样使用Syntax 在使用Hooks API时,我们如何别名道具?,syntax,reason,bucklescript,reason-react,Syntax,Reason,Bucklescript,Reason React,以前,我是这样使用[@bs.as“in”]的 [@bs.deriving abstract] type cssTransitionProps = { [@bs.as "in"] _in: bool, timeout: int, classNames: string, }; 我怎么能在这里做类似的事情 module CSSTransition = { [@bs.module "react-transition-group"] [@react.component] exte
[@bs.as“in”]
的
[@bs.deriving abstract]
type cssTransitionProps = {
[@bs.as "in"]
_in: bool,
timeout: int,
classNames: string,
};
我怎么能在这里做类似的事情
module CSSTransition = {
[@bs.module "react-transition-group"] [@react.component]
external make:
(
~_in: bool,
~timeout: int,
~classNames: string,
~children: React.element
) =>
React.element =
"CSSTransition";
};
你不必做任何bucklescript会为你做的事情 如果您查看js输出,您将看到中的
\u被转换为
中的
return React.createElement(ReactTransitionGroup.CSSTransition, {
in: match$2[0],
timeout: 200,
classNames: "my-node",
children: React.createElement("div", undefined, React.createElement(CommandsArea.make, {
text: text,
setText: match[1]
}), React.createElement(Toolbar.make, {
result: match$1[0]
}))
});