React-router-dom bindings for Reason


This repository contains simple bucklescript bindings for react-router-dom v4.

There are some small differences in usage, mainly depending on how reason-react wants components to be passed as props.

The Route component expects a componentMake containing the wrapped component’s make function.

<Route path="/2" componentMake=Foo.make />

For components like Link or NavLink which expect a to prop containing either a string or an object, you’ll have to pass either a _to: string or a toObj: Js.t ({.. pathname: string} as 'a).

<NavLink _to="/"> ... </NavLink>
<NavLink toObj={"pathname": "/2"}> ... </NavLink>

Please not that this never intended to be a complete implementation of the library and that it was written as an exercise. Despite that, it works correctly except for a couple of missing things:

  • matchPath
  • withRouter
  • some types need to be improved

Related Posts

Resizing and moving windows in Doom Emacs

Setting up TabNine on Doom Emacs

The correct docker-compose setup for Wordpress and Nginx

Adding a newline after a comment block in Doom Emacs

PureScript Date and Time guide

Adding live css and js reload to Yesod

A quick overview of Purescript package managers as of October 2018

Optional elements and properties in Halogen

Simple AJAX in Purescript

Automatically adding (or removing) a prefix to a record labels in Purescript