React Native Error - TypeError: toClose is not a function. (In 'toClose()', 'toClose' is undefined)

Viewed 18

I need help regarding this code. Please send help thank you!

const create = ({navigation, user, toClose, toSubmit}) => {
     const submitDetails = () => {
        if (!name.trim() && !code.trim()) return toClose();
        toSubmit(name, code);
        setName("");
        setCode("");
        toClose();
    };
}

enter image description here

enter image description here

It keeps saying this. On the sample code that I am working with it works for them.

0 Answers
Related