Skip to content

Commit

Permalink
Update ClientApp in kitchen-sink to demonstrate infinite loading
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobbe committed May 11, 2024
1 parent 9e65cc9 commit 1bfc8ef
Showing 1 changed file with 22 additions and 14 deletions.
36 changes: 22 additions & 14 deletions __fixtures__/test-project-rsc-kitchen-sink/web/src/ClientApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,28 @@ import FatalErrorPage from './pages/FatalErrorPage/FatalErrorPage'
import './index.css'
import './scaffold.css'

const AboutPage = renderFromRscServer('__rwjs__router-about')

const App = () => {
console.log('ClientApp')

// Always render the AboutPage for now without causing lint errors regarding
// unused variables/unused code
if (Math.random() < 5) {
return <AboutPage />
}

return (
<FatalErrorBoundary page={FatalErrorPage}>
<RedwoodProvider titleTemplate="%PageTitle | %AppTitle">
<RedwoodApolloProvider>
<VirtualClientRouter analyzedRoutes={analyzedRoutes} />
</RedwoodApolloProvider>
</RedwoodProvider>
</FatalErrorBoundary>
)
}

// const NavigationLayout = renderFromRscServer('NavigationLayout')
const NavigationLayout = ({ children }: { children: React.ReactNode }) => {
return (
Expand Down Expand Up @@ -86,18 +108,4 @@ const analyzedRoutes = {
activeRoutePath: serializedRoutes.activeRoutePath,
}

const App = () => {
console.log('ClientApp')

return (
<FatalErrorBoundary page={FatalErrorPage}>
<RedwoodProvider titleTemplate="%PageTitle | %AppTitle">
<RedwoodApolloProvider>
<VirtualClientRouter analyzedRoutes={analyzedRoutes} />
</RedwoodApolloProvider>
</RedwoodProvider>
</FatalErrorBoundary>
)
}

export default App

0 comments on commit 1bfc8ef

Please sign in to comment.