// modules/NavLink.js
import React from 'react'
import { Link } from 'react-router'
export default React.createClass({
render() {
//for example this.props={from: "home", to: "about"}
return <Link {...this.props} activeClassName="active"/> // ???what does the statement compile to es5?
}
})
// modules/App.js
import NavLink from './NavLink'
// ...
<li><NavLink to="/home">Home</NavLink></li>问题如下:
<Link {...this.props} activeClassName="active"/>,如果this.props={ to:"/home",es5:"Home"},语句会编译成什么?
https://stackoverflow.com/questions/41389544
复制相似问题