yeojz / metalsmith-react-templates

A metalsmith plugin to render files using React / Preact / JSX based templates.
MIT License
92 stars 17 forks source link

React 0.14, babel, etc #19

Closed VinSpee closed 8 years ago

VinSpee commented 8 years ago

Hi!

I tried running your examples and am getting this error:

> examples@0.0.1 build /Users/vinspee/projects/metalsmith-react-templates/examples
> node index.js

Warning: DefaultTemplate(...): React component classes must extend React.Component.
/Users/vinspee/projects/metalsmith-react-templates/examples/index.js:24
      throw err;
      ^

Invariant Violation: DefaultTemplate.render(): A valid ReactComponent must be returned. You may have returned undefined, an array or some other invalid object.
    at invariant (/Users/vinspee/projects/metalsmith-react-templates/node_modules/fbjs/lib/invariant.js:39:15)
    at ReactCompositeComponentMixin._renderValidatedComponent (/Users/vinspee/projects/metalsmith-react-templates/node_modules/react/lib/ReactCompositeComponent.js:613:156)
    at wrapper [as _renderValidatedComponent] (/Users/vinspee/projects/metalsmith-react-templates/node_modules/react/lib/ReactPerf.js:66:21)
    at ReactCompositeComponentMixin.mountComponent (/Users/vinspee/projects/metalsmith-react-templates/node_modules/react/lib/ReactCompositeComponent.js:220:30)
    at wrapper [as mountComponent] (/Users/vinspee/projects/metalsmith-react-templates/node_modules/react/lib/ReactPerf.js:66:21)
    at /Users/vinspee/projects/metalsmith-react-templates/node_modules/react/lib/ReactServerRendering.js:42:38
    at ReactServerRenderingTransaction.Mixin.perform (/Users/vinspee/projects/metalsmith-react-templates/node_modules/react/lib/Transaction.js:136:20)
    at Object.renderToString (/Users/vinspee/projects/metalsmith-react-templates/node_modules/react/lib/ReactServerRendering.js:40:24)
    at exports.default (/Users/vinspee/projects/metalsmith-react-templates/lib/renderReactTemplates.js:49:40)
    at /Users/vinspee/projects/metalsmith-react-templates/lib/index.js:111:48

any ideas what could be causing this?

yeojz commented 8 years ago

Can't seem to reproduce the error. Possibly a conflict of React versions since the examples ain't updated yet.

yeojz commented 8 years ago

I've updated the examples to react 0.14. Maybe try again and check if you still see the error?

yeojz commented 8 years ago

Closing this issue due to inactivity.

Reopen when needed.