Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

@moox/bs-react-helmet

3.0.0 • Public • Published

@moox/bs-react-helmet

Reason / BuckleScript bindings for React Helmet, a document head manager for React.

Install

yarn add react-helmet @moox/bs-react-helmet

Note that you need react, react-dom, reason-react and react-helmet as peer dependencies.

Adjust your bsconfig.js by adding this package:

  "bs-dependencies": [
    "reason-react",
    "@moox/bs-react-helmet"
  ]

Usage

let component = ReasonReact.statelessComponent("CommonThings");
 
let make = (_) => {
  ...component,
  render: _self =>
    <BsReactHelmet defaultTitle="This is a title">
      <style>
        (
          {j|
html {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", sans-serif;
}
|j}
          |> ReasonReact.string
        )
      </style>
    </BsReactHelmet>
};

Server-side static rendering

let helmet = BsReactHelmet.renderStatic();
let title = helmet##title##toString();

Follow official documentation for all methods available.


CHANGELOG

LICENSE

Install

npm i @moox/bs-react-helmet

DownloadsWeekly Downloads

195

Version

3.0.0

License

MIT

Unpacked Size

6.45 kB

Total Files

6

Last publish

Collaborators

  • avatar