react-router-defer

0.4.2 • Public • Published

react-router-defer

GitHub stars

Adds deferred asynchronous rendering to react router

Please ★ this repo if you found it useful ★ ★ ★

Features

  • Adds asynchronous componentDefer method prop to Route component
  • Adds asynchronous renderDefer method prop to Route component
  • Adds asynchronous deferred hook to history.push

Installation

npm install --save react-router-defer

Dependencies

Usage

import React, { Component } from 'react';
import { Switch, Route } from 'react-router-defer';
 
export default class Routes extends Component {
  render() {
    return (
      <Switch>
        <Route exact path="/" componentDefer={() => import('./Home')} />
        <Route componentDefer={() => import('./NotFound')} />
      </Switch>
    );
  }
}

Contribute usage docs

Support

Submit an issue

Screenshots

Contribute a screenshot

Contributing

Review the guidelines for contributing

License

MIT License

Jam Risser © 2018

Changelog

Review the changelog

Credits

Support on Liberapay

A ridiculous amount of coffee ☕ ☕ ☕ was consumed in the process of building this project.

Add some fuel if you'd like to keep me going!

Liberapay receiving Liberapay patrons

Package Sidebar

Install

npm i react-router-defer

Weekly Downloads

0

Version

0.4.2

License

MIT

Unpacked Size

20.3 kB

Total Files

9

Last publish

Collaborators

  • codejamninja