Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supporting other virtual doms. #55

Open
DylanPiercey opened this issue Jul 1, 2015 · 3 comments
Open

Supporting other virtual doms. #55

DylanPiercey opened this issue Jul 1, 2015 · 3 comments

Comments

@DylanPiercey
Copy link

Currently it's pretty easy to use something like https://github.com/dekujs/deku using coffee-react since you can do:

# @cjsx deku
Car = React.createClass
  render: ->
    <Vehicle {...@props.parts}>
      <Parts.FrontSeat />
      <Parts.BackSeat />
      <p>Which seat can I take? {@props.seat or 'none'}</p>
    </Vehicle>

Which becomes:

`/** @jsx deku */`
Car = React.createClass
  render: ->
    deku.createElement(Vehicle, React.__spread({},  @props.parts),
      deku.createElement(Parts.FrontSeat, null),
      deku.createElement(Parts.BackSeat, null),
      deku.createElement("p", null, "Which seat can I take? ", (@props.seat or 'none'))
    )

However you will notice "React.__spread" which is obviously not compatible.
Is it possible to have @jsx also modify React.__spread?

@jsdf
Copy link
Owner

jsdf commented Jul 1, 2015

Looks like this is a regression, previously if you provided something like # @cjsx deku.dom it would just work.

@DylanPiercey
Copy link
Author

Is it possible to fix or is it an issue with the jsx transform?

@jsdf
Copy link
Owner

jsdf commented Jul 1, 2015

It's a pretty simple fix, the correct value just needs to be output here: https://github.com/jsdf/coffee-react-transform/blob/master/src/serialiser.coffee#L105

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants