shadcn <DropdownMenu> TS Error 'DropdownMenu' Refers to a Value, but Used as a Type
Answered
Chartreux posted this in #help-forum

ChartreuxOP
I'm exploring shadcn's data table and I reach this point https://ui.shadcn.com/docs/components/data-table#row-actions . I added the dropdown and pasted the code correctly, but I got errors such as
From the images, I guess the problem is the imported dropdown components aren't being recognized (from the muted import text).
What's the real issue here? And how to solve it?
The left-hand side of an assignment expression must be a variable or a property access.ts(2364)
'DropdownMenu' refers to a value, but is being used as a type here. Did you mean 'typeof DropdownMenu'
From the images, I guess the problem is the imported dropdown components aren't being recognized (from the muted import text).
What's the real issue here? And how to solve it?



3 Replies

@joulev name your file .tsx instead of .ts

ChartreuxOP
Ahhh, you're right
I didn't realize it. Thank you