r/nextjs •

[deleted by user]

[deleted] — view deleted post

0 Upvotes

3 comments sorted by

0

u/[deleted] Oct 07 '24

[deleted] — view deleted comment

1

u/Alternator24 Oct 07 '24

oh. that means I forgot wrapping it around double quotes?!

holy moly. how could I be that dumb.

sorry man. you are right.

2

u/jessepence Oct 07 '24

You're not dumb, this is a super common mistake. typeof always returns a string. This and expecting the typeof null to not be 'object' are probably the two most common mistakes I see when people use it.

2

u/Alternator24 Oct 08 '24

I felt embarrassed about it. You know, I’ve been doing react for 5 years.

how could I make such mistake 🤦‍♂️