I passed the deleteImgfunc function from the insertFarmDiaryDetail component to the InsertFarmDiarySubPage component, which is a child component. The deleteImgfunc function is a function that receives parameters.
So, like my code, even though I created an interface and a value that receives parameters, a red warning line appears in v?.name and this warning message occurs.
Expected 0 arguments, but got 1 error.
How can I get rid of this warning? How do I fix my code?
this is my code
(insertFarmDiaryDetail.tsx)
const insertFarmDiaryDetail = () => {const deleteImgfunc = useCallback((value) => {}, []);return (<InsertFarmDiarySubPage deleteImgfunc={deleteImgfunc}/>)}
(InsertFarmDiarySubPage.tsx)
interface IProps { deleteImgfunc?: () => void;}v = {index: 0name: "growthLength 1"size: 22396type: "image/jpeg"uri: "hjk"}const InsertClass44 = forwardRef(({ deleteImgfunc }: IProps, ref: any): JSX.Element => { return (<Pressable} onPress={() => deleteImgfunc?.(v?.name)}></Pressable> );})export default InsertClass44;