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

Arrow function does not have prototype #14

Open
RettentoRectangle opened this issue May 15, 2019 · 0 comments
Open

Arrow function does not have prototype #14

RettentoRectangle opened this issue May 15, 2019 · 0 comments

Comments

@RettentoRectangle
Copy link

Hello,

First of all I'd like to thanks for this lib but I think I found a bug in it.

Example code:
const B = (props) => (<A foo="predefined" { ...props } />)

In dom composeToFunction function there is a row:
var bridge = JSXTag.prototype.render ? new JSXTag(props).render : JSXTag;

You are trying to check JSXTag.prototype.render function but when you pass arrow function there is no prototype.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions#Use_of_prototype_property

It would be fantastic if you could fix this. :)
Use this:
var bridge = JSXTag.prototype && JSXTag.prototype.render ? new JSXTag(props).render : JSXTag;

Cheers, keep up the good work!

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

1 participant