Skip to content

Latest commit

 

History

History
29 lines (21 loc) · 1.04 KB

prefetching.md

File metadata and controls

29 lines (21 loc) · 1.04 KB

Prefetching - coming soon!

For now, checkout:

articles:

pre-requesite packages:

Redux First Router will allow you to specify chunks in your routesMap and your <Link /> components will have a prefetch prop you can set to true to prefetch associated chunks. An imperative API via the instance ref will exist too:

const routesMap = {
  FOO: { path: '/foo/:bar', chunks: [import('./Foo')] }
}

// declarative API:
<Link prefetch href='/foo/123' />
<Link prefetch href={{ type: 'FOO', payload: { bar: 456 } }} />

// imperative API: 
<Link ref={i => instance = i} href='/foo/123' />
instance.prefetch()