代码拉取完成,页面将自动刷新
ReScript bindings to react-on-rails.
# yarn
yarn add rescript-react-on-rails
# or npm
npm install --save rescript-react-on-rails
type props = {"name": string};
type context = {"host": string};
let component = (props: props, context: context) => {
// ReactOnRails require a component as return (not a react element)
// That can be done by wrapping the return with a function
(. ()) => <Page name={props["name"]} host={context["host"]} />
}
ReactOnRails.register("App", component)
// ReactOnRails.register
ReactOnRails.register("App", component);
// ReactOnRails.registerWithOptions
ReactOnRails.registerWithOptions("App", component, {traceTurbolinks: true});
// ReactOnRails.authenticityToken
let csrfToken: option<string> = ReactOnRails.authenticityToken();
// ReactOnRails.reactOnRailsPageLoaded
ReactOnRails.reactOnRailsPageLoaded();
No redux
related methods are exposed as there're no redux
bindings exist and it's not idiomatic way to manage state in ReScriptReact
apps.
See react-on-rails
JS API for more details.
MIT.
The following companies support our open source projects, and ShakaCode uses their products!
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。