How to send and receive data using React Route?

I have a react-js and a normal javascript part of a project. I figured out how to navigate between the two of them. Now I also want to send data between them. I have this code:

       <Route exact path="/" render={() => {window.location.href="tv/indexTv.html"}} />

How can I pass extra data (like a string)? How can I receive it? Or can I somehow pass data to the html, or to a javascript file from my App.js (React) without using route?


You could use something like redux or the useContext hook to store data:

or use query params:

I’d suggest you use query params, since it is way easier and much less setup