Failed to compile when using react-native-elements in create-react-native-web-app project
See original GitHub issueI’ve been redirected from here.
Explain what you did Trying to create a react-native web project, following this tutorial
The bug When adding react-native-elements and react-native-vector-icons, and editing the webpack as described in the walkthrough, I receive
Failed to compile.
./node_modules/react-native-ratings/src/SwipeRating.js
SyntaxError: /Users/arthur/workspace/ReactNativeWorkspace/sfcc/web-sandbox-test/node_modules/react-native-ratings/src/SwipeRating.js: Support for the experimental syntax 'classProperties' isn't currently enabled (41:23):
39 |
40 | export default class SwipeRating extends Component {
> 41 | static defaultProps = {
| ^
42 | type: 'star',
43 | ratingImage: require('./images/star.png'),
44 | ratingColor: '#f1c40f',
Add @babel/plugin-proposal-class-properties (https://git.io/vb4SL) to the 'plugins' section of your Babel config to enable transformation.
when running yarn web
To Reproduce
To reproduce you can simply follow along the instructions in the walkthrough, and when you replace <TouchableHighlight> with <Button> you should receive the same error
Environment
| software | version |
|---|---|
| react-native-vector-icons | ^6.2.0 |
| react-native-elements | ^1.0.0 |
| react-native | 0.55.x |
| npm | 6.5.0 |
| yarn | 1.13.0 |
| OS | macOS High Sierra 10.13.4 |
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:10 (3 by maintainers)
Top Results From Across the Web
Error while adding react native elements to react native
Since "native" packages don't include compiled code (es5 after babel and jsx transformation), to use them in web you must add the libraries ......
Read more >React Native Web
Comprehensive Guide to create simple app using React Native Web and React Native Elements.
Read more >Comprehensive Guide to Creating Simple Apps using React ...
Have you ever wondered, is it possible to create an (Android | iOS | Website) app using single codebase? The answer: Yes, it...
Read more >Blog | React Native Elements
ToC#. Initialize the project using CRNWA; Make sure everything works: Android, iOS and Web; Add RNE latest ( 1.0.0-beta7 ) to the project;...
Read more >react-native-elements - npm
React Native Elements & UI Toolkit. Latest version: 3.4.3, last published: 2 days ago. Start using react-native-elements in your project by ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@arthurpankiewicz @thorakmedichi as suggested by @iRoachie , if you guys following this tutorial, you just need to add
react-native-ratingsandreact-native-status-bar-heightto webpack config.RNE version:
Result:
See this PR for more details, #1.
Hey @arthurpankiewicz you may have to add
react-native-ratingsto you webpack config as well https://gist.github.com/haruelrovix/01d335dfcabec17a6aa5bc7a53fef277. Let me know if that works