Welcome to 16892 Developer Community-Open, Learning,Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

The path in the match object doesn't match the route if the route has a dynamic part on the first load but works fine after a reload.

For example, visiting the link /v/:videoId from a different link on the initial application load videoId is undefined. After a hard refresh of the page however, videoId is now accessible.

Route for the router:

<Route path="/v/:videoId" component={withRouter(VideoPage)} exact />

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
531 views
Welcome To Ask or Share your Answers For Others

1 Answer

等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to 16892 Developer Community-Open, Learning and Share
...