BuckleScript bindings to react-on-rails
npm install bs-react-on-railsBuckleScript bindings to react-on-rails.
shell
yarn
yarn add bs-react-on-railsor npm
npm install --save bs-react-on-rails
`Usage
`reason
type props = {. "name": string};type context = {. "host": string};
let component = (props: props, context: context) =>
;
ReactOnRails.register("App", component);
`See example Rails app and implementation commit.
API
`reason
/ ReactOnRails.register /
ReactOnRails.register("App", component);/ ReactOnRails.registerWithOptions /
ReactOnRails.registerWithOptions("App", component, {traceTurbolinks: true});
/ ReactOnRails.registerWithOptions /
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 ReasonReact apps.react-on-rails` JS API for more details.