我是React Redux的新手。所以,这里我有这条路线
<PrivateRoute exact path="/quiz-setup/:job" component={QuizSetupMain} />
所以,在行动中,我打电话
history.push({
pathname: '/quiz-setup/'+`${this.props.selectedJdName}`
})
现在,
return hasUserLogIn ?
(
<Route
{...rest}
path={path}
component={Component}
/>
)
:
(
<Redirect
to={{
pathname: "/login",
state: { from: path }
}}
/>
)
所以,这里是路线
喜欢
http://localhost:3000/quiz-setup/ganesh1
那个时候两个请求进入一个请求,另一个请求在另一个组件中接收props,一个请求现在在这个componetdidmout中,第一个请求的URL更改为
http://localhost:3000/quiz-setup/api/
quiz-setup gets added in that url so that I get `404`. for the same receiveprops it hits the proper url can any one help me with this ?