I have used Link and react Router dom to navigate and pass props.
Here is my function
pageRelocator(mssg) {
window.localStorage.removeItem("mssg");
if (mssg.length < 35) {
window.location.href = "http://localhost:3000/completed-assessment";
} else if (mssg.length > 35) {
window.localStorage.setItem("mssg", mssg);
window.location.href = `http://localhost:3000/user-questions`;
}
}
I would like to conditionally navigate to a page and pass the prop mssg through.
I am fully aware how to do this through redirect/ Link etc but my understanding is that this is done within the jsx how would I navigate AND pass props through to a page doing it in this manner.