Next.js Discord

Discord Forum

How to bypass destruction checker on object in client list component?

Unanswered
Transvaal lion posted this in #help-forum
Open in Discord
Transvaal lionOP
My session error modal is in the jsx render but the !profile is the first to check and then my modal is not pop unless i return the !profile to null


page

1 Reply

Chum salmon
I wish ppl give me context when they ask a question. It could be hundred of things. So I'm just guessing here.

I assume you have something like this:
const { profile } = useMerchantList();
if (!profile) return null;

If so, why don't you make it so that profile is nullable? And use the null to conditionally display error modal or the actual content?