In React, we can pass data from one component to another using props but I want to know how to pass data from one component to another while issueing an API request.
In the backend, the signin credentials are authenticated using "JWT authentication".
How to pass the the username while the user is getting logged in? When the user get's logged in, my page should show "welcome ".
You can check out the code in this CodeSanbox
Here is the json data from the API:
{
item: [
{
"id": "145741863",
"firstName": "ABCDEF",
"email": "[email protected]",
"password": "Aertyuio",
}
]
}