D
D
darkDARK2020-05-26 15:07:36
React
darkDARK, 2020-05-26 15:07:36

How to set up routing so that the necessary information is displayed?

I have two indexes 1 and 2 on the page . Clicking on 1 redirects to /event/1 , clicking on 2 redirects to /event/2 .
I need the /event/1 and /event/2 pages to display the name and time that I pass there

/event/1

name: Kate
time: 15s


/event/2

name: Mark
time: 23s


Please help me finish it! Everything I have done so far is below
https://codesandbox.io/s/magical-tu-z4it1?file=/sr...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Robur, 2020-05-26
@Robur

Remove the react-native tag.
you can pass name and time through props, use render instead of component, then you can pass whatever you want there:
https://reacttraining.com/react-router/web/api/Rou...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question