wix-incubator / react-templates

Light weight templates for react
https://wix.github.io/react-templates
MIT License
2.82k stars 207 forks source link

how to stand for es6 #199

Open moxiaobei2 opened 7 years ago

moxiaobei2 commented 7 years ago

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:

hahahhhhhhh====>{this.state.name}

it's error,can't done

moxiaobei2 commented 7 years ago

I got the answers: render() { return template.apply(this); } =*=

nippur72 commented 7 years ago

better is:

import template from './Home.rt';
class Home extends Component { ... }
Home.prototype.render = template;
Fasani commented 7 years ago

Is this project forked and maintained anywhere?

nippur72 commented 7 years ago

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.