Skip to content
Advertisement

Why props is not being passed by history.push?

SignIn.js I am redirecting the page using history.push but with it i am also passing the “username” but this username i am not able to see it in the redirected page “ADMIN.JS”.Since the username user enter that username i want to see it in the redirected page. All other content in admin.js are visible but only {username} is not visible.

JavaScript

Admin.js

JavaScript

Advertisement

Answer

As you can read in getting-started:

Pass the state:

JavaScript

and read from the state:

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement