【发布时间】:2019-04-01 14:02:07
【问题描述】:
警告:函数作为 React 子级无效。如果您从渲染返回一个组件而不是
<Component />,则可能会发生这种情况。或者您可能打算调用此函数而不是返回它。
跨度
在一个
在里
在 ul
在 div
在 div
在 div
在页眉中
在 div
在 div
在 t
在大师
在连接(主)
在开关
在路由器中
在提供者中
const store = configureStore();
store.dispatch(generalActionLoad());
ReactDOM.render(
<Provider store={store}>
<Router history={history}>
{routes}
</Router>
</Provider>
, document.getElementById('app')
);
我的 routes.js :
export default (
<Switch>
<Route exact path="/abcd" component={Locked} />
{/* <Route onEnter={requireAuth}> */}
<Master >
< Switch >
<Route exact path="/abcdefg" component={abcdefg}/>
</ Switch>
</Master>
{/* </Route>; */}
<Route exact path="*" components={NotFound} />
</Switch>
);
【问题讨论】:
-
首先,将 abcdefg 改为 Abcdefg。那么,你可以发布 abcdefg 吗?另外,当你在浏览器中访问 xxx/abcd 时会发生什么?当你去 xxx/abcd 会发生什么? (xxx是你运行app时打开的http路径)
标签: reactjs react-native react-redux react-router