Skip to content

Latest commit

 

History

11 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Creasync Build Status Dependency Status

Asynchronous route and component for react.

Using webpack chunking, the imported component's chunk will be automatically be created. With this, We can also implement the lazy loading component and error component.

Methods

The creasync method accepts an object.

component - component path.

error - error component to be rendered.

loading - loading component to be rendered.

Sample

import creasync from 'creasync'

const NewComponent = creasync({
    component: System.import('url-to-component'),
    error: () => (<div>Something went wrong...</div>),
    loading: () => (<div>loading component...</div>)
})

Examples

See the examples directory.

run the server

npm run examples:serve

then run webpack

npm run examples:webpack

Disclaimer

Work in progress

About

Asynchronous routes and components for react

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages