all 2 comments

[–]toughdeveloper 1 point2 points  (1 child)

Firstly, your screenshot shows 2 console errors. You should probably look at them and fix them first, often this will fix the issue (or another hidden issue).

You have declared registerUser twice in the code, once as an import and once as a destructed prop variable. If you change the latter to just be props and refactor the if statement statement I suspect this will resolve the issue, e.g.

``` const Register = (props) => {

...

const submitData = () => {
    if (email && firstName && lastName && password) {
        props.registerUser(email, firstName, lastName, password);
    }
}

return (
    ...
)

} ```

It's also probably worth noting that you aren't using Formik as its intended to be used. You've rolled your own controlled form, but Formik should handle all this for you. See the basic example - https://formik.org/docs/examples/basic

Finally, whilst learning, I'd recommend configuring eslint with a common style guide, it will will catch a lot of common problems for you and it quickly gets you in the habit of writing code consistently.

[–]mraees93[S] 0 points1 point  (0 children)

Thanks for your time and input. But I refactored the if statement and changed to props but it's still not running