How to use @shopify/react-server - 1 common examples

To help you get started, we’ve selected a few @shopify/react-server examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Shopify / quilt / packages / react-server-webpack-plugin / src / templates / server.ts View on Github external
import React from 'react';
import {createServer, DefaultProvider} from '@shopify/react-server';
// @ts-ignore
import App from 'index';

const render = ctx =>
  React.createElement(
    DefaultProvider,
    null,
    React.createElement(App, {
      server: true,
      location: ctx.request.url,
    }),
  );

const app = createServer({
  render,
});

export default app;

@shopify/react-server

Utilities for React server-side rendering

MIT
Latest version published 5 months ago

Package Health Score

53 / 100
Full package analysis

Popular @shopify/react-server functions

Similar packages