-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Closed
Labels
Description
I'm using React Router as a...
framework
Reproduction
Created a freshly new repository. Created minimal example:
https://github.com/laimonassutkus/ReactRouterV7-HttpStreaming
Just run "npm run dev", open the browser and timeout later happens.
How do I increase the timeout beyond 5 seconds ?
Code at a glance
Loader:
export async function loader({}: Route.LoaderArgs) {
const msgPromise = new Promise((res) =>
setTimeout(() => res("Hello World!"), 6_000)
);
return {msg: msgPromise};
}Page:
export default function MyComponent({loaderData}: Route.ComponentProps) {
let {msg} = loaderData;
return (
<div>
<React.Suspense fallback={<div>Loading...</div>}>
<Await resolve={msg}>
{(value) => <h3>{value}</h3>}
</Await>
</React.Suspense>
</div>
);
}System Info
Chrome, Mac, dependencies:
"@react-router/node": "^7.0.2",
"@react-router/serve": "^7.0.2",
"isbot": "^5.1.17",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-router": "^7.0.2"Used Package Manager
npm
Expected Behavior
No timeout happens or at least there is a way to increase it.
Actual Behavior
Always timeout if promise resolves in more that 5 seconds.
candidia and WillSmithTE