I am passing a value from one component to another in React. Creating a updatable table from APIs on Database. The code will recognise the values in the new form when edit button is clicked, but when I try to pass them into the useState it is blank.
This is weird. I was able to use useState without any problem.
It is hard for me to understand your setup to figure out the issue. Could you provide me with a simple example where this is the case?
I am passing a value from one component to another in React. Creating a updatable table from APIs on Database. The code will recognise the values in the new form when edit button is clicked, but when I try to pass them into the useState it is blank.
Here is where I passed them into new component:
export const EditEmployee=({open,onClose,empName,dep,Doj,Mail,ID})=>{
I have tried setting useState to the variable, but it does not read it.
Here I set the default value on form and it reads it just fine.
This is weird. I was able to use
useState
without any problem. It is hard for me to understand your setup to figure out the issue. Could you provide me with a simple example where this is the case?