How to use @marionebl/react-router - 3 common examples

To help you get started, we’ve selected a few @marionebl/react-router 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 patternplate / patternplate / packages / client / src / app / entry.js View on Github external
return new Promise(resolve => {
    const eventEmitter = new EventEmitter();
    const base = url.resolve(global.location.pathname, data.base);

    Router.run(getRoutes(base), Router.HistoryLocation, (Handler, state) => {
      const appData = { ...data, ...state, eventEmitter, base };
      resolve(ReactDOM.render(, el));
    });
  });
}
github patternplate / patternplate / packages / client / src / app / entry.js View on Github external
return new Promise(resolve => {
    const eventEmitter = new EventEmitter();

    Router.run(getRoutes(), path, (Handler, state) => {
      const appData = { ...data, ...state, eventEmitter, base: "/" };
      resolve(ReactDOMServer.renderToString());
    });
  });
}
github patternplate / patternplate / packages / client / src / app / server.js View on Github external
export default function(location, data) {
  const sheet = new ServerStyleSheet();
  const memoryHistory = createMemoryHistory(location);
  const store = configureStore(memoryHistory, data);
  const history = syncHistoryWithStore(memoryHistory, store);

  return new Promise((resolve, reject) => {
    match(
      {
        history,
        routes: routes(store),
        location
      },
      (error, redirect, props) => {
        if (error) {
          return reject(error);
        }
        const context = sheet.collectStyles(

@marionebl/react-router

A complete routing library for React

MIT
Latest version published 7 years ago

Package Health Score

69 / 100
Full package analysis