Hello I wanna know if is possible to Parse data from a button from a component to another component I know you can parse data in the following way:
<Component data = {data} />
But I wanna send it through a button because I need to change of "page" when I send the data if that makes sense ?
I did try the following (Is just an example):
const sendData= () => {
<Component data = {data} />
history.push("/sendData");
};
<Button onClick={sendData} >Click to send data</Button>
I got in return the following output:
As you can see I was sending some data and got undefined in return, I did a similar question before but didn't got a proper answer and haven't find a way to do it.
Any tips, help, documentation is welcome.
Edit: This is what I wanna send ->
I wanna send all the data from a variable that hold that data to another page so I can use it there.

