Socket
Book a DemoInstallSign in
Socket

bs-react-on-rails

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bs-react-on-rails

BuckleScript bindings to react-on-rails

0.2.0
latest
Source
npmnpm
Version published
Weekly downloads
1
-83.33%
Maintainers
1
Weekly downloads
 
Created
Source

bs-react-on-rails

BuckleScript bindings to react-on-rails.

Installation

# yarn
yarn add bs-react-on-rails

# or npm
npm install --save bs-react-on-rails

Usage

type props = {. "name": string};

type context = {. "host": string};

let component = (props: props, context: context) =>
  <Page name=props##name host=context##host />;

ReactOnRails.register("App", component);

See example Rails app and implementation commit.

API

/* 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.

See react-on-rails JS API for more details.

License

MIT.

Keywords

react

FAQs

Package last updated on 19 Apr 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.