1 | { this .props.redirectTo?<Redirect to={ this .props.redirectTo} />: null } |
请问老师 这句代码为什么是这样写
1 2 3 4 5 6 7 8 9 | render() { return ( <div> { this .props.redirectTo?<Redirect to={ this .props.redirectTo} />: null } <Logo></Logo> <h2>注册页面</h2> <WingBlank> <List> ...... |
但是以下这样写就没有效果呢?
1 2 3 4 5 6 7 8 9 | render() { this .props.redirectTo?<Redirect to={ this .props.redirectTo} />: null return ( <div> <Logo></Logo> <h2>注册页面</h2> <WingBlank> <List> ...... |
全网唯一的React 16+Redux+React Router4实战课程,学到手是你的真本领!
了解课程