[React] React Router: activeStyle & activeClassName
2016-03-28 04:34
681 查看
react-router provides two props for setting a specific style on a Link component whose path matches our current route. activeStyle allows for an inline style while activeClassName allows for an class defined in an external stylesheet.
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>;
.active{ color: green; }
相关文章推荐
- [React] React Router: Router, Route, and Link
- Redux 的黑魔法
- Mac安装ReactNative
- 【ReactJS】一、手把手搭建ReactJS开发环境(Sublime)
- 【ReactJS】一、手把手搭建ReactJS开发环境(Sublime)
- ReactiveCocoa使用记录
- React 教程及其API接口文档
- 轻松入门React和Webpack
- 深入浅出React Native 2: 我的第一个应用
- React(0.13) 组件的组合使用
- React-架构模式
- 将React Native集成至Android原生应用
- MVVM、Reactive Cocoa
- 搭建react-native for android的windows开发环境
- ReactNative入门 —— 动画篇(上)
- 深入浅出React Native 1: 环境配置
- << React Native 入门与实战>>----第2章 React Native开发基础
- ReactJS学习笔记——组件复合及表单的处理
- React-Native run-android报错以及adb 命令不识别
- React Native 解决iOS上键盘遮挡TextInput问题