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

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

Adding static files to Yesod

Planning a simple Reddit clone with Yesod

Parsing complex foreign objects in PureScript

A way to deal with big objects and FFI.

Post requests with PureScript Affjax and Argonaut

Simple ajax calls to an API example

Functor, Applicative e Monad illustrati

Una guida chiara

Arbitrary length lists with QuickCheck

Using sized to build arbitrary length lists for QuickCheck