react-native-animatable icon indicating copy to clipboard operation
react-native-animatable copied to clipboard

React Native Web support on new ejected create-react-app TypeScript project

Open kopax-polyconseil opened this issue 4 years ago • 1 comments

We are experiencing issue configuring webpack with this module because of the class property here:

https://github.com/oblador/react-native-animatable/blob/ccafe141921912f21f1ad006ba8c3fb2191d6afc/createAnimatableComponent.js#L132

./node_modules/react-native-animatable/createAnimatableComponent.js
SyntaxError: /home/dka/workspace/github.com/pass-culture/pass-culture-app-native/node_modules/react-native-animatable/createAnimatableComponent.js: Support for the experimental syntax 'classProperties' isn't currently enabled (133:24):

  131 | 
  132 |   return class AnimatableComponent extends Component {
> 133 |     static displayName = `withAnimatable(${wrappedComponentName})`;
      |                        ^
  134 | 
  135 |     static propTypes = {
  136 |       animation: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),

Add @babel/plugin-proposal-class-properties (https://git.io/vb4SL) to the 'plugins' section of your Babel config to enable transformation.
If you want to leave it as-is, add @babel/plugin-syntax-class-properties (https://git.io/vb4yQ) to the 'plugins' section to enable parsing.

I have tried to follow the recommendation but couldn't get a working configuration, did anyone succeeded to configure this package with webpack?

kopax-polyconseil avatar Jul 19 '21 08:07 kopax-polyconseil

Did you make it work?

trigonometric-act avatar Mar 09 '22 12:03 trigonometric-act