3 Replies
the problem in react code , the try block is not executing and catch blockis also not executing ...
and in express it shows 'undefined' value
Console Logs inside fetch fn but not inside try block
This looks like an incomplete example, I'm guessing that the component code is incorrect and the JavaScript code doesn't run to completion, running into an error.
As an aside, do not use capital letters when defining functions. Specially in React, which requires components to be in upper case. I don't know if this is the issue here, or even if it's an issue at all when dealing with functions declared inside components, but it's just good practice.
I'm sorry , i forget to close this post , the error is actually I use cors , express.json, urlencoded on controller file not on main server.js file