snd / react-kup

react-kup is a simple, nonintrusive alternative to JSX for coffeescript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Doesn't work on React v0.12.0

mizchi opened this issue · comments

Uncaught Error: Invariant Violation: ReactCompositeComponent.render(): A valid ReactComponent must be returned. You may have returned undefined, an array or some other invalid object. 
commented

hey mizchi,

sorry for taking so long to react !

i just tried to reproduce the problem with react 0.12.0 and 0.12.1.
all tests pass - i could not reproduce it and have no idea what to fix.

could you post a minimal code example that produces your problem.
i'll be happy to fix it then !

best
max

Hi all.

I have same error has occur like this: Uncaught Error: Invariant Violation: ReactCompositeComponent.render(): A valid ReactComponent must be returned. You may have returned undefined, an array or some other invalid object..

Code is

React = require 'react/addons'
kup = require 'react-kup'

HelloMessage = React.createClass
  render: -> kup (k)=> k.div "Hello #{@props.name}"

init = ->
  mountNode = document.getElementById 'user'
  component = new HelloMessage
    name: 'John'

  React.renderComponent component, mountNode

and browserified. However, I was wrong to be carefully read README.

kup = require 'react-kup' is correctly was kup = require('react-kup')(React). And it is worked with react@0.12.2.

I thought the same mistake.

Thanks

commented

thanks for the effort !

i'll make that clearer in the readme soon.