hapi-render-react
Table of Contents
Install
yarn add hapi-render-react
npm install hapi-render-react
Usage
const Server = ;const Main = ;const RenderReact = ;const Path = ; const PORT = 3001 } = processenv; const server = port: PORT; ;
pages/home.js:
; <p>Hello hello</p>;
pages/hello.js:
; <p>Hello name</p>;
_document
inspired by Next.js.
You can customize how a view is rendered. Example of a _document to support React-Helmet:
const React = ;const HelmetProvider = ;const renderToString renderToNodeStream = ; module { const helmetContext = {}; const appHtml = ; const helmet = helmetContext; const bodyAttributes htmlAttributes link meta noscript script style title } = helmet; const htmlAttrs = htmlAttributes; const bodyAttrs = bodyAttributes; const bodyHtml = ; return ;};
License
BSD-3-Clause