onClick event handler not firing for button #10590
-
I've started migrating my app from Remix V1 to V2 (after a good while), but now I found that for some reason my buttons are not working; there is an import { useLoaderData, useNavigate } from "@remix-run/react";
import { calculateMaxInboxes } from "../../components/misc";
export default function Inboxes() {
const [user, inboxes] = useLoaderData();
const navigate = useNavigate();
return (
<div style={{marginTop: "8%", display: "flex", alignItems: "center", flexDirection: "column", height: "100%"}}>
<button disabled={inboxes.length >= calculateMaxInboxes(user)} onClick={() => navigate("/inboxes/create")}>Create New Inbox</button> I also saw the omitting of export default function App() {
const user = useLoaderData();
return (
<html lang="en">
<head>
<meta charSet="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<Meta />
<Links />
</head>
<body style={{margin: 0, height: "100%"}}>
<Navbar user={user} />
<Outlet />
<ScrollRestoration />
<Scripts />
<LiveReload />
</body>
</html>
);
} My hunch is that it's some weird SSR related bug, but I'm not proficient enough in React or Remix.js to know what to look for. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I found the problem; I had a custom |
Beta Was this translation helpful? Give feedback.
I found the problem; I had a custom
entry.server.jsx
which I assume was also affected by the migration. I just deleted it so Remix rolled with the default and now my scripts are back to normal!