where is the navigate method? (for nextui) #1987
Replies: 1 comment
-
i got it: import { createInertiaApp, router } from "@inertiajs/react";
import { NextUIProvider } from "@nextui-org/react";
import { createRoot } from "react-dom/client";
createInertiaApp({
resolve: (name) => {
const pages = import.meta.glob("./Pages/**/*.jsx", { eager: true });
return pages[`./Pages/${name}.jsx`];
},
setup({ el, App, props }) {
createRoot(el).render(
<NextUIProvider navigate={(path) => router.visit(path)}>
<App {...props} />
</NextUIProvider>
);
},
}); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
nextui allows us to specify the navigation method for integrating with client side routers:
https://nextui.org/docs/guide/routing
for example, with react router, you'd use:
what is the equivalent of this
useNavigate
hook with inertia?i asked chatgpt, does this look correct:
Beta Was this translation helpful? Give feedback.
All reactions