以下是嵌套代码ReactDOM.render( <HashRouter> <App> <Route path='/login' component={Login} /> </App> </HashRouter>, document.getElementById('root')父路由App的代码constructor(props) { super(props); this.state = { userName: '123' } }render() { return <div className="App"> {this.props.children} </div> }如何向子路由login传递userName这个参数?
添加回答
举报
0/150
提交
取消