Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(novu): wrap novu variable in usememo to fix build error #7688

Open
wants to merge 3 commits into
base: next
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
"use client";

import { Novu } from "@novu/js";
import { useEffect, useState } from "react";
import { useEffect, useState, useMemo } from "react";
import { Inbox } from "@novu/nextjs";
import { useRouter } from "next/navigation";
import styles from "./Notifications.module.css"; // You'll need to create this

const NotificationToast = () => {
const novu = new Novu({
subscriberId: process.env.NEXT_PUBLIC_NOVU_SUBSCRIBER_ID || "",
applicationIdentifier:
process.env.NEXT_PUBLIC_NOVU_APPLICATION_IDENTIFIER || "",
});
const novu = useMemo(
() =>
new Novu({
subscriberId: process.env.NEXT_PUBLIC_NOVU_SUBSCRIBER_ID || "",
applicationIdentifier:
process.env.NEXT_PUBLIC_NOVU_APPLICATION_IDENTIFIER || "",
}),
[],
);

const [showToast, setShowToast] = useState(false);

Expand Down Expand Up @@ -62,5 +67,9 @@ const novuConfig = {
};

export function NovuInbox() {
return <Inbox {...novuConfig} />;
const router = useRouter();

return (
<Inbox {...novuConfig} routerPush={(path: string) => router.push(path)} />
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ export default function Home() {
Inbox Playground
</a>
. You can customize the Inbox component to match your
application's design.
application&apos;s design.
</p>
</div>
<a
Expand Down Expand Up @@ -264,7 +264,7 @@ export default function Home() {
</li>
<li className={styles.bulletItem}>
<div className={styles.bullet}></div>- Trigger a reminder
notification if user hasn't completed an action
notification if user has not completed an action
</li>
<li className={styles.bulletItem}>
<div className={styles.bullet}></div>- Schedule
Expand Down
Loading