How to use the fusion-react.split function in fusion-react

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

github fusionjs / fusion-cli / test / e2e / dynamic-import-app-group-preloading / fixture / src / root.js View on Github external
// @noflow

import React from 'react';
import Router, {Route, Switch, Link} from 'fusion-plugin-react-router';
import {split} from 'fusion-react';

const LoadingComponent = () => <div />;
const ErrorComponent = () => <div />;

const A = split({
  load() {
    return import('./split-a');
  },
  LoadingComponent,
  ErrorComponent,
});

const B = split({
  load() {
    return import('./split-b');
  },
  LoadingComponent,
  ErrorComponent,
});

export default function Root() {
github fusionjs / fusion-cli / test / e2e / split-translations / fixture / src / routes.js View on Github external
// @noflow
import React from 'react';
import {split} from 'fusion-react';

const LoadingComponent = () => <div>Loading...</div>;
const ErrorComponent = () => <div>Error</div>;

export default [
  {
    path: '/split1',
    component: split({
      load() {
        return import('./split1');
      },
      LoadingComponent,
      ErrorComponent,
    }),
    exact: true,
  },
  {
    path: '/split2',
    component: split({
      load() {
        return import(/* webpackChunkName: "named-chunk" */ './split2');
      },
      LoadingComponent,
      ErrorComponent,
github fusionjs / fusion-cli / test / fixtures / dynamic-import-app / src / routes.js View on Github external
import React from 'react';
import {split} from 'fusion-react';

const LoadingComponent = () => <div />;
const ErrorComponent = () => <div />;

export default [
  {
    path: '/split-route',
    component: split({
      load() {
        return import('./split-route');
      },
      LoadingComponent,
      ErrorComponent,
    }),
    exact: true,
  },
  {
    path: '/split-route-content',
    component: split({
      load() {
        return import('./split-route-content');
      },
      LoadingComponent,
      ErrorComponent,
github fusionjs / fusion-cli / test / e2e / dynamic-import-app-group-preloading / fixture / src / root.js View on Github external
import React from 'react';
import Router, {Route, Switch, Link} from 'fusion-plugin-react-router';
import {split} from 'fusion-react';

const LoadingComponent = () => <div />;
const ErrorComponent = () => <div />;

const A = split({
  load() {
    return import('./split-a');
  },
  LoadingComponent,
  ErrorComponent,
});

const B = split({
  load() {
    return import('./split-b');
  },
  LoadingComponent,
  ErrorComponent,
});

export default function Root() {
  return (
    <div>
      <Switch>
        <Route exact path={'/split-a'} component={A} />
        <Route exact path={'/split-b'} component={A} />
      </Switch>
    </div>
  );

fusion-react

FusionJS entry point for React universal rendering

MIT
Latest version published 2 months ago

Package Health Score

74 / 100
Full package analysis

Similar packages