Closed vitalijalbu closed 3 months ago
usePage
doesn't come with any preloaded data. It spits out whatever you bind to it. What's preventing you from sharing request()->all()
in your middleware?
Issues should be saved for actual bug reports.
Ok thanks, I think documentation is not complete and can be improved… there are a lots of things that many starter devs don’t find on docs website and find replies elsewhere…
Documentation can't include everything that a dev might think a package should do because they used something vaguely similar and that package did it.
Inertia is simply a bridge between your Laravel controllers and your frontend. It is not designed to be a do-everything framework.
Why not use something like
const urlParams = new URLSearchParams(window.location.search);
const myParam = urlParams.get('myParam');
or you could Inertia::share
an array that tells your navbar which items to include rather than doing so on the frontend.
Good recommendations here for sharing/accessing params. Closing this issue for now, since this lives in the Ideas discussions: https://github.com/inertiajs/inertia/discussions/1768
Version:
@inertiajs/react
version: latestDescribe the problem:
Hi guys, I'm coming from nextjs to inertiajs, really a good product and I love it. But there's a route minus. Of course it can be fixed, but would be fine having it as default. Problem: Would be great to have query params as props also, like Nextjs, so we can access it like:
const { id, query, url } = usePage();
This is my current code to create a dynamic navbar, based o nthe id of the url:
See more here: https://github.com/inertiajs/inertia/discussions/1768