27
50%
MIT
bs-next
3.0.0
Reason bindings for Next.js

bs-next

Reason bindings for Next.js v6.

API

Bindings are provided for the only two components provided by Next.js:

Example

  • RE
  • ML
let component = ReasonReact.statelessComponent("Index");

let make = (_children) => {
  ...component,
  render: (_self) =>
    <div>
      <Next.Head>
        <title> (ReasonReact.stringToElement("My Page Title")) </title>
      </Next.Head>

      <Next.Link href="/about">
        <a> (ReasonReact.stringToElement("About")) </a>
      </Next.Link>
    </div>
}
let component = ReasonReact.statelessComponent "Index"
let make _children =
  {
    component with
    render =
      (fun _self  ->
         ((div
             ~children:[((Next.Head.createElement
                            ~children:[((title
                                           ~children:[ReasonReact.stringToElement
                                                        "My Page Title"] ())
                                      [@JSX ])] ())[@JSX ]);
                       ((Next.Link.createElement ~href:"/about"
                           ~children:[((a
                                          ~children:[ReasonReact.stringToElement
                                                       "About"] ())[@JSX ])]
                           ())[@JSX ])] ())[@JSX ]))
  }