Open moxiaobei2 opened 7 years ago
I got the answers: render() { return template.apply(this); } =*=
better is:
import template from './Home.rt';
class Home extends Component { ... }
Home.prototype.render = template;
Is this project forked and maintained anywhere?
no there is no "official" fork that I know. But in my nippur72/react-templates I have merged the PR that here are waiting to be reviewed.
import React ,{ Component, PropTypes}from 'react' import { connect } from 'react-redux' import { bindActionCreators } from 'redux'; import template from './Home.rt'; //import LinkedStateMixin from 'react-addons-linked-state-mixin'; import linkState from 'react-link-state'; import mixin from 'es6-react-mixins';
/**
*/
class Home extends Component {
constructor(props,context){ super(props,context); this.state={ "name":"ling" } } render() { return template(); } }
export default Home;
then .rt:
it's error,can't done