// 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>
的quesion的JSX ES6对象传播经营者低于:在reactjs
<Link {...this.props} activeClassName="active"/>
,这句话是什么编译为ES5,如果this.props = {到: “/家庭”,孩子们:“首页“}?
你可以找到你自己:https://babeljs.io/repl/。 –