wix-incubator / react-templates

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

is there any way to use component without requiring? #29

Closed dfguo closed 9 years ago

dfguo commented 9 years ago

Sometimes we define multiple component classes in one file since they won't be reused anywhere else, but when we use it in react-template, we are forced to separate those classes in different files. Is there anyway to do:

component.coffee

ComponentA = React.createClass 
  render: ->
    rtA.apply(this)

ComponentB = React.createClass
  render: ->
    rtB.apply(this)

componentA.rt

<ComponentB />

componentB.rt

<div> hello </div>
idok commented 9 years ago

Next version adds support for jsrt, inline rt which could solve your issue.

dfguo commented 9 years ago

that's good to hear. thanks