Skip to content

Commit

Permalink
fix(react-imported-component: use new suspense style API
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickleet committed Jan 23, 2020
1 parent f3db062 commit 6a6d0cb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
14 changes: 7 additions & 7 deletions app/App.jsx
@@ -1,18 +1,18 @@
import React from 'react'
import { Switch, Route, Redirect } from 'react-router-dom'
import importComponent from 'react-imported-component'
import { lazy, LazyBoundary } from 'react-imported-component'
import { GlobalStyles } from './styles'
import Header from './components/Header'
import Home from './pages/Home'
import LoadingComponent from './pages/Loading'
import ErrorComponent from './pages/Error'

const About = importComponent(() => import('./pages/About'), {
LoadingComponent,
ErrorComponent
})
const About = lazy(() => import('./pages/About'))

export const renderAboutPage = () => <About />
export const renderAboutPage = () => (
<LazyBoundary fallback={<LoadingComponent />}>
<About />
</LazyBoundary>
)

const App = () => (
<React.Fragment>
Expand Down
1 change: 0 additions & 1 deletion app/client.js
Expand Up @@ -3,7 +3,6 @@ import ReactDOM from 'react-dom'
import { HelmetProvider } from 'react-helmet-async'
import { BrowserRouter } from 'react-router-dom'
import { rehydrateMarks } from 'react-imported-component'
import importedComponents from './imported' // eslint-disable-line
import App from './App'

export const hydrate = (app, element) => () => {
Expand Down

0 comments on commit 6a6d0cb

Please sign in to comment.