Property 'assetType' does not exist on type 'IntrinsicAttributes'
Answered
Donskoy posted this in #help-forum
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
Rafael Almeida
the component in the error is
Popup
but the code you are showing is for a component named Assets
🤔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
Rafael Almeida
what is the definition of the
Popup
component? it sounds like it doesn't accept this propAnswer
DonskoyOP
definition?
DonskoyOP
DirtyCajunRice | AppDir
you havent set any props for this component.
DonskoyOP
props in the image above? or the OG one?
DirtyCajunRice | AppDir
you are passing props to popup which has no props.
DonskoyOP
AHH IT WORKED! thank you!