CRA Universal

CRA Universal

  • Docs
  • API
  • Help
  • Blog

›@cra-express/core

cra-universal

  • CLI

@cra-express/core

  • API

API

This is API doc for upcoming v4

createReactAppExpress

  • clientBuildPath
    • used in production bundle, for public path
  • universalRender
    • Handler that accepts express req and res object and must return React element or Promise of React element
  • handleRender
    • Handler for which rendering stragegy used. You can choose stringRenderer or streamRenderer from @cra-express/universal-loader. Default to stringRenderer

Example

const path = require('path');
const React = require('react');
import { createReactAppExpress } from '@cra-express/core';

let App = require('../src/App').default;
const clientBuildPath = path.resolve(__dirname, '../client');

const app = createReactAppExpress({
  clientBuildPath,
  universalRender: (req, res) => <App />
});
← CLI
  • createReactAppExpress
    • Example
CRA Universal
Docs
Getting StartedDeployment GuideAPI Reference
Community
Stack OverflowSpectrumTwitter
More
BlogGitHubStar
Copyright © 2020 Antony Budianto