How to use @jaredpalmer/after - 3 common examples

To help you get started, we’ve selected a few @jaredpalmer/after 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 charliewilco / downwrite / afterdown / src / client.js View on Github external
import React from 'react'
import { hydrate } from 'react-dom'
import { BrowserRouter as Router } from 'react-router-dom'
import { ensureReady, After } from '@jaredpalmer/after'
import './client.css'
import routes from './routes'

ensureReady(routes).then(data => {
  console.log(data)
  hydrate(
    
      
    ,
    document.getElementById('root')
  )
})

if (module.hot) {
  module.hot.accept()
}
github SaraVieira / awesome-talks / src / routes.js View on Github external
import Loading from './Components/Styling/Loading'
import { asyncComponent } from '@jaredpalmer/after'

export default [
  {
    path: '/',
    exact: true,
    component: asyncComponent({
      loader: () => import('./Pages/Home'),
      Placeholder: () => 
    })
  },
  {
    path: '/speakers',
    exact: true,
    component: asyncComponent({
      loader: () => import('./Pages/Speakers'),
      Placeholder: () => 
    })
  },
  {
    path: '/speaker/:speaker',
    exact: true,
    component: asyncComponent({
      loader: () => import('./Pages/Speaker'),
      Placeholder: () => 
    })
  },
  {
    path: '/category/:category',
    exact: true,
    component: asyncComponent({
github jaredpalmer / after.js / examples / basic / src / _routes.js View on Github external
import './index.css';
import React from 'react';
import asyncComponent from '@jaredpalmer/after/asyncComponent';
import Home from './Home';

export default [
  {
    path: '/',
    exact: true,
    component: Home,
  },
  {
    path: '/about',
    exact: true,
    component: asyncComponent({
      loader: () => import('./About'),
      Placeholder: () =&gt; <div>LOADING...</div>,
    }),
  },
  {
    path: '/redirect_test',
    redirectTo: '/',
    pathMatch: 'full',
  },
  {
    path: '**',
    component: () =&gt; 'Not Found!',
  },
];

@jaredpalmer/after

Build isomorphic Javascript applications with ease.

MIT
Latest version published 3 years ago

Package Health Score

57 / 100
Full package analysis

Similar packages