- nav导航点击后样式(刷新页面不变)
//react-router提供了两种道具链接组件上设置一个特定的风格的路径匹配我们目前的路线。activeStyle允许内联风格而activeClassName允许一个类中定义一个外部样式表。 const Links = () => <nav > <Link activeStyle={{color: 'green'}} to="/">Home</Link> <Link activeStyle={{color: 'green'}} to="/about">About</Link> <Link activeClassName="active" to="/contact">Contact</Link> </nav>; //css样式 .active{ color: green; }
-
使用react-router之后,如何向子组件传递一个事件handler? 参考链接:https://segmentfault.com/q/1010000007620558
- 嵌套路由传值 == this.props.children 跳转获取路由
1 { this.props.children && React.cloneElement( 2 this.props.children , { isShow : this.isShow.bind(this)} 3 )}
- react 中添加
setTimeout 访问链接
- 在React 中抛弃 .bind(this) 参考链接