所有的路由都是在我的app.js中完成的。然而,在我的路线上,我收到了多个相同的错误-我没有通过我的应用程序的这部分道具,所以我不知道为什么我收到这个。
我收到的错误
[1] ./src/App.js
[1] Line 70:36: No duplicate props allowed react/jsx-no-duplicate-props
[1] Line 71:31: No duplicate props allowed react/jsx-no-duplicate-props
[1] Line 72:39: No duplicate props allowed react/jsx-no-duplicate-props
[1] Line 73:44: No duplicate props allowed react/jsx-no-duplicate-props
[1] Line 78:11: No duplicate props allowed react/jsx-no-duplicate-props
[1] Line 85:11: No duplicate props allowed react/jsx-no-duplicate-props
[1] Line 91:11: No duplicate props allowed react/jsx-no-duplicate-props
[1] Line 94:42: No duplicate props allowed react/jsx-no-duplicate-props
[1] Line 95:39: No duplicate props allowed react/jsx-no-duplicate-props
[1] Line 99:11: No duplicate props allowed react/jsx-no-duplicate-props
[1] Line 103:47: No duplicate props allowed react/jsx-no-duplicate-props
[1] Line 104:47: No duplicate props allowed react/jsx-no-duplicate-props
[1] Line 108:11: No duplicate props allowed react/jsx-no-duplicate-props
[1] Line 114:11: No duplicate props allowed react/jsx-no-duplicate-props
[1] Line 120:11: No duplicate props allowed react/jsx-no-duplicate-props
[1] Line 126:11: No duplicate props allowed react/jsx-no-duplicate-props
[1] Line 132:11: No duplicate props allowed react/jsx-no-duplicate-props
[1] Line 138:11: No duplicate props allowed react/jsx-no-duplicate-props我的app.js的路由部分
<BrowserRouter>
<Switch>
<Route exact path="/reset" exact component={ResetPassword} />
<Route exact path="/" exact component={LoginPage} />
<Route exact path="/Register" exact component={RegisterPage} />
<Route exact path="/confirm-email" exact component={ConfirmEmail} />
<RegisterAuthRoute
exact
path="/confirm-register"
exact
component={ConfirmRegisterPage}
/>
<ResetAuthRoute
exact
path="/confirm-Password"
exact
component={ConfirmPassword}
/>
<AuthRoute
exact
path="/profile-update-account-details"
exact
component={UpdateAccountDetailsPage}
/>
<AuthRoute exact path="/profile" exact component={ProfilePage} />
<AuthRoute exact path="/home" exact component={Home} />
<AuthRoute
exact
path="/user-questions"
exact
component={UserQuestions}
/>
<AuthRoute exact path="/user-history" exact component={History} />
<AuthRoute exact path="/admin-center" exact component={AdminCenter} />
<AuthRoute
exact
path="/admin-question-editor"
exact
component={AdminQuestionEditor}
/>
<AuthRoute
exact
path="/admin-view-users"
exact
component={AdminViewUsers}
/>
<AuthRoute
exact
path="/admin-view-users-severity-high"
exact
component={AdminViewUsersSeverityHigh}
/>
<AuthRoute
exact
path="/admin-view-users-severity-medium"
exact
component={AdminViewUsersSeverityMedium}
/>
<AuthRoute
exact
path="/admin-view-users-severity-completed"
exact
component={AdminViewUsersSeverityCompleted}
/>
<AuthRoute
exact
path="/admin-view-users"
exact
component={AdminViewUsers}
/>
</Switch>
</BrowserRouter>本质上问题是。为什么我会收到这个错误?如何解决此错误?
发布于 2020-01-27 13:47:49
看起来你要两次把exact道具传递到每条路线。
详见react路由器文档。
https://stackoverflow.com/questions/59932342
复制相似问题