jedireza / hapi-react-views

:package: A hapi view engine for React components
MIT License
231 stars 33 forks source link

Check for default export in es2015 files #32

Closed tanepiper closed 9 years ago

tanepiper commented 9 years ago

When using ES2015 with Babel6, it appears you need to check for the default export when the react template is transpiled.

This adds a check to see if Component.default exists, if it does then it uses this instead to pass to React.createFactory

jedireza commented 9 years ago

Adding this link for future reference: http://stackoverflow.com/q/33505992

jedireza commented 9 years ago

Thanks for creating a PR! I left a few minor comments inline. We'll need to add tests for this and figure out why TravisCI is failing.

tanepiper commented 9 years ago

@jedireza Tests are failing because you're testing against Hapi 11, which only supports node >4 now (see build https://travis-ci.org/jedireza/hapi-react-views/builds/89329509)

tanepiper commented 9 years ago

@jedireza FYI - Happy to help migrate this library through to ES2015 and ensure support for > Hapi 11 and Babel 6

tanepiper commented 9 years ago

@jedireza Changes reverted as per comments

jedireza commented 9 years ago

I left a PR on your fork to update the readme. After you merge that, squash the commits into one and then we can merge. The final commit message could be something like hapi 11 + node 4 + better es6 support, but it's up to you.

If you need help with squashing see:

jedireza commented 9 years ago

This was fun. Thank you.

:shipit: on a :ship:

tanepiper commented 9 years ago

@jedireza Thank you! Glad I could help make this happen :dancer: