JSPM

  • Created
  • Published
  • Downloads 1291
  • Score
    100M100P100Q99633F
  • License MIT

React bindings for Reason

Package Exports

  • reason-react
  • reason-react/lib/js/src/ReactDOMRe.js
  • reason-react/lib/js/src/ReasonReact.js
  • reason-react/lib/js/src/ReasonReactRouter.js
  • reason-react/src/ReactDOMRe.js
  • reason-react/src/ReasonReact.js
  • reason-react/src/ReasonReactCompat.js
  • reason-react/src/ReasonReactRouter.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (reason-react) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

ReasonReact

Chat

Example

/* Greeting.re */
[@react.component]
let make = (~name) => <h1> {React.string("Hello " ++ name)} </h1>

in another file:

ReactDOMRe.renderToElementWithId(<Greeting name="Taylor" />, "root");

For a more in-depth example, see: https://github.com/reasonml-community/reason-react-hacker-news

Quick start

BuckleScript compiles ReasonML code to JavaScript. You can get it with:

npm install --global bs-platform
bsb -init my-react-app -theme react-hooks
cd my-react-app && npm install && npm start
# in another tab
npm run server

Documentation

See https://reasonml.github.io/reason-react/

Contribute

git clone https://github.com/reasonml/reason-react.git
cd reason-react
npm install
npm start

Then add some files somewhere (don't forget to change bsconfig.json, if needed).

See the README inside src for more info!