npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@minoris/react-html

v4.1.1

Published

A component to render your react app with no static HTML.

Readme

@minoris/react-html

Build Status License: MIT npm version

A component to render your React app with no static HTML.

Installation

$ yarn add @minoris/react-html

Usage

The <HTML> component serves as a top level wrapper for a react application, allowing you to avoid needing any kind of server side template, in favor of purely using reactDom.renderToString.

import * as React from 'react';
import {renderToString} from 'react-dom/server';

import HTML, {DOCTYPE} from '@minoris/react-html';
import MyApp from '../app';

export default (ctx, next) => {
  // we have to prepend DOCTYPE to serve valid HTML
  ctx.body = DOCTYPE + renderToString(
    <HTML>
      <MyApp />
    </HTML>
  );

  await next();
}

Due to limitations in React’s implementation of HTML, you still need to prepend the <!DOCTYPE html> directive. To assist with this the module also exports a DOCTYPE constant.

The component will automatically propagate any usage of the react-helmet module in your app’s content to manipulate the title or other top level HTML or HEAD attributes.

Interface

export interface Props {
  children?: React.ReactNode;
  styles?: Asset[];
  scripts?: Asset[];
  blockingScripts?: Asset[];
  headData?: {[id: string]: any};
  data?: {[id: string]: any};
  hideForInitialLoad?: boolean;
}

interface Asset {
  path: string;
  integrity?: string;
}

interface Browser {
  userAgent: string;
  supported: boolean;
}

Basic props

Most simple applications will only need these basic properties.

children The children to be rendered inside the #app div.

styles Descriptors for any style tags you want to include in the HEAD of the document.

scripts Descriptors for any script tags you want to include in your document. All scripts passed to this property will be deferred by appending them to the end of the document. We encourage this as a default, although you may use blockingScripts for any scripts that must be included in the HEAD of the document.

blockingScripts Descriptors for any script tags you want to include in the HEAD of the document. These will block HTML parsing until they are evaluated, so use them carefully.

hideForInitialLoad Sets the body contents to be hidden for the initial render. Use this when injecting stylesheets dynamically in development in order to prevent a flash of unstyled content.

Serializers

These props are useful for more complex applications that want to synchronize Redux, Apollo, translation, or any other data across the network boundary. These props are stringified into the DOM using (@minoris/react-serialize)[https://github.com/minoris-io/quilt/blob/master/packages/react-serialize/README.md].

headData Any serializable data that needs to be available from the DOM when the synchronousScripts are run.

data Any serializable data that needs to be available from the DOM when the deferredScripts are run.

Asset Components

This module also exports the asset components the <HTML /> component uses internally for its script and style props.

import {Style, Script} from '@minoris/react-html';

Style

The <Style /> component lets you render <link> tags in your document dynamically as part of your react app.

<Style
  href="./some-style.css"
  integrity="some-integrity-hash"
  crossOrigin="anonymous"
/>

Script

The <Script /> component lets you render <script> tags in your document dynamically as part of your react app.

<Script
  src="./some-script.js"
  integrity="some-integrity-hash"
  crossOrigin="anonymous"
/>