Current parameter passing method:
<Link to={`/topics/${topic.id}`}>{topic.title}</Link>
1. Is the method of passing parameters correct?
Then jump to the next page, the address bar is:
http://localhost:8080/topics/33119
I thought this.props.params.id could get the parameters this way, but it doesn’t seem to work.
2. How to obtain the address bar parameters?
It has been solved. It is still somewhat different from react-router. Question and answer:
1. Routing configuration
2. Page before jumping
3. Get parameters from page topics after jumping
Determine the id based on the address of the router