I have an app in which I show records in the form of cards. I have a browse page, a record detail page and a filter detail page.
The record detail page is a subpage of the browse page.
When I click on a card in the browse page, the Suspense isn't tiggered and I don't see anything untill the data is fetched.
When I click on a card in the filter detail page and I get redirected to the record detail page, the Suspense works and I see the skelleton while fetching the data.
I use the latest experimental versions of react and relay.
Index.jsx
import React, { Suspense } from 'react';
import ReactDOM from 'react-dom';
import { BrowserRouter, Routes, Route } from 'react-router-dom';
import { RelayEnvironmentProvider } from 'react-relay/hooks';
import App from './components/App/index';
import ErrorPage from './components/pages/Error';
import relayEnvironment from './relayEnvironment';
import Skelleton from './components/App/Skelleton';
ReactDOM.unstable_createRoot(
document.getElementById('root'),
).render(
<React.StrictMode>
<RelayEnvironmentProvider environment={relayEnvironment}>
<BrowserRouter>
<Suspense fallback={<Skelleton />}>
<Routes>
<Route path="/">
<Route path=":subdomain/*" element={<App />} />
<Route element={<ErrorPage message="Without a subdomain, we cannot find the niche..." />} />
</Route>
</Routes>
</Suspense>
</BrowserRouter>
</RelayEnvironmentProvider>
</React.StrictMode>,
);
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Problem
I have an app in which I show records in the form of cards. I have a browse page, a record detail page and a filter detail page. The record detail page is a subpage of the browse page.
When I click on a card in the browse page, the Suspense isn't tiggered and I don't see anything untill the data is fetched. When I click on a card in the filter detail page and I get redirected to the record detail page, the Suspense works and I see the skelleton while fetching the data.
I use the latest experimental versions of react and relay.
Index.jsx
App.jsx
Browse.jsx
Record.jsx
PreloadRoute.jsx