Next.js Discord

Discord Forum

Property 'assetType' does not exist on type 'IntrinsicAttributes'

Answered
Donskoy posted this in #help-forum
Open in Discord
Avatar
DonskoyOP
this is the only error i have, and cant seem to figure out the solution...the beginning of the code starts like this
interface PopupProps { assetType: string; assetURL: string; onClose: () => void } export default function Assets({assetType, assetURL, onClose} : PopupProps) { const [selectedAsset, setSelectedAsset] = useState<PopupProps | null>(null) const openPopup = (assetType: string, assetURL: string) => { setSelectedAsset({ assetType: assetType, onClose: closePopup, assetURL: assetURL, }); } const closePopup = () => { setSelectedAsset(null) }
Image
Answered by Rafael Almeida
what is the definition of the Popup component? it sounds like it doesn't accept this prop
View full answer

10 Replies

Avatar
Rafael Almeida
the component in the error is Popup but the code you are showing is for a component named Assets 🤔
Avatar
DonskoyOP
im showing in the description the beginning of the code, i could only upload one picture. the image provided is where the error is
this is the beginning of the code. but the error im having is line 58
Image
Avatar
Rafael Almeida
what is the definition of the Popup component? it sounds like it doesn't accept this prop
Answer
Avatar
DonskoyOP
definition?
Avatar
DonskoyOP
Image
Avatar
DirtyCajunRice | AppDir
you havent set any props for this component.
Avatar
DonskoyOP
props in the image above? or the OG one?
Avatar
DirtyCajunRice | AppDir
you are passing props to popup which has no props.
Avatar
DonskoyOP
AHH IT WORKED! thank you!