-
Notifications
You must be signed in to change notification settings - Fork 506
Closed
Labels
reactRelated to the react adapterRelated to the react adapter
Description
inertiajs/inertia-laravel
Version: "^2.0"
@inertiajs/react
version: "^2.0.0",
Describe the problem:
I want to partially reload some data from the server only when the component mounts.
Steps to reproduce:
useEffect(() => {
router.reload({only: [key]});
}, []);
When I navigate to this page using client-side routing (from another page), everything works fine.
However, when I do a full page refresh, I get an error and the request is not sent to the server.
Here’s the error message:
@inertiajs_react.js?v=8ed0a2f8:6373 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'component')
This is the line of code that triggers the error:
this.isPartial() && (e["X-Inertia-Partial-Component"] = s.get().component);
Metadata
Metadata
Assignees
Labels
reactRelated to the react adapterRelated to the react adapter