我使用react-router-component。
获取此错误: 未捕获的TypeError:无法读取null的属性'ref'
var Locations = Router.Locations;
var Location = Router.Location;
var NotFound = Router.NotFound;
var APP =
React.createClass({
render:function(){
return (
<Template>
<Locations>
<location path="/" handler={Frontpage} />
<location path="/new-estate" handler={NewEstate} />
</Locations>
</Template>
)
}
});
此行在控制台中标记为导致错误的行(由星号标记):
var RouteRenderingMixin = {
renderRouteHandler: function(props) {
var handler = this.state.handler;
**props = assign({ref: this.state.match.route.ref}, props);**
// If we were passed an element, we need to clone it before passing it along.
if (React.isValidElement(handler)) {
return cloneWithProps(handler, props);
}
return React.createElement(handler, props);
}
};
如何解决?