App failed to compile for web if the library is only supported for iOS and Android but not for web

Viewed 25

I'm using a library called react-native-modals which is supported only for iOS and Android and is working fine on both platforms. But when I run the app on web, it fails to compile:

  /node_modules/react-native-animatable/createAnimatableComponent.js
 SyntaxError: /home/rohits/RR/React-native/typtap-policyholder-web- 
mobile/node_modules/react-native-animatable/createAnimatableComponent.js: Support for 
the experimental syntax 'jsx' isn't currently enabled (599:9):

  597 |
  598 |       return (
> 599 |         <Animatable
      |         ^
  600 |           ref={this.handleRef}
  601 |           style={[
  602 |             style,

Add @babel/preset-react (https://git.io/JfeDR) to the 'presets' section of your Babel 
config to enable transformation.
If you want to leave it as-is, add @babel/plugin-syntax-jsx (https://git.io/vb4yA) to 
the 'plugins' section to enable parsing.

Compilation errors occur even if I use other libraries which are not supported on web.

0 Answers
Related