You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 19, 2022. It is now read-only.
I've been successfully using Radium with the standard es2015 Babel preset.
Since our generated code runs on Node 5, I wanted to try out babel-preset-node5. With this preset, Babel is no longer translating class to ES5 constructs, since Node 5 supports classes out of the box.
However, when wrapping our component classes with Radium, I get this error:
TypeError: Class constructors cannot be invoked without 'new'
Here is a code snipped which reproduces the error:
importReactfrom'react';importradiumfrom'radium';classFooextendsReact.Component{render(){return<div>Hello</div>;}}constWrappedFoo=radium(Foo);newWrappedFoo();// TypeError: Class constructors cannot be invoked without 'new'
My .babelrc:
{
"presets": ["stage-0", "node5", "react"]
}
There seems to be some logic in the Radium wrapper that is not compatible with real ES2015 classes.
natew, yornaath, alaingalvan, eXaminator and begincalendar