Property 'assetType' does not exist on type 'IntrinsicAttributes'
Answered
Donskoy posted this in #help-forum
![Avatar](https://cdn.discordapp.com/embed/avatars/2.png)
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)
}
Answered by Rafael Almeida
what is the definition of the
Popup
component? it sounds like it doesn't accept this prop10 Replies
![Avatar](https://cdn.discordapp.com/guilds/752553802359505017/users/258390283127881728/avatars/6d84d27ad734d86c3c3d7f004660bded.webp?size=256)
Rafael Almeida
the component in the error is
Popup
but the code you are showing is for a component named Assets
🤔![Avatar](https://cdn.discordapp.com/embed/avatars/2.png)
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
![Avatar](https://cdn.discordapp.com/guilds/752553802359505017/users/258390283127881728/avatars/6d84d27ad734d86c3c3d7f004660bded.webp?size=256)
Rafael Almeida
what is the definition of the
Popup
component? it sounds like it doesn't accept this propAnswer
![Avatar](https://cdn.discordapp.com/embed/avatars/2.png)
DonskoyOP
definition?
![Avatar](https://cdn.discordapp.com/embed/avatars/2.png)
DonskoyOP
![Avatar](https://cdn.discordapp.com/avatars/184479429404262410/a_35db4fb943e84d39bb02d6ec0f1d0b7e.gif?size=256)
DirtyCajunRice | AppDir
you havent set any props for this component.
![Avatar](https://cdn.discordapp.com/embed/avatars/2.png)
DonskoyOP
props in the image above? or the OG one?
![Avatar](https://cdn.discordapp.com/avatars/184479429404262410/a_35db4fb943e84d39bb02d6ec0f1d0b7e.gif?size=256)
DirtyCajunRice | AppDir
you are passing props to popup which has no props.
![Avatar](https://cdn.discordapp.com/embed/avatars/2.png)
DonskoyOP
AHH IT WORKED! thank you!