Cannot initialize a vanilla js react-native project
Description
I'm trying to get npx react-native@latest init AwesomeProject working with vanilla js and babel
React Native Version
0.71.7
Output of npx react-native info
info Fetching system and libraries information... System: OS: Linux 6.1 Void CPU: (8) x64 Intel(R) Core(TM) i5-10210U CPU @ 1.60GHz Memory: 8.61 GB / 15.30 GB Shell: 5.9 - /bin/zsh Binaries: Node: 19.9.0 - ~/.nvm/versions/node/v19.9.0/bin/node Yarn: Not Found npm: 9.6.3 - ~/.nvm/versions/node/v19.9.0/bin/npm Watchman: Not Found SDKs: Android SDK: Not Found IDEs: Android Studio: 4.1 AI-201.8743.12.41.7199119 Languages: Java: 11.0.12 - /usr/bin/javac npmPackages: @react-native-community/cli: Not Found react: 18.2.0 => 18.2.0 react-native: 0.71.7 => 0.71.7 npmGlobalPackages: react-native: Not Found
Steps to reproduce
Steps to reproduce:
-
npx [email protected] init AwesomeProject - Rename
App.tsxtoApp.jsxand remove typescript declarations. Note thatnpm startandnpm run androidwork fine without typescript, and you can safely removetsconfig.json - Try to run the tests using
npm testand note that it works. - Try to rename
App-test.tsxtoApp-test.jsx, which should work, but throws this error:
/home/risto/projects/AwesomeProject/__tests__/App-test.jsx:5
import 'react-native';
^^^^^^
SyntaxError: Cannot use import statement outside a module
I tried to get jest to work by adding the @babel/plugin-transform-modules-commonjs plugin to babel, but it didn't work.
Snack, code example, screenshot, or link to a repository
https://github.com/Risto-Stevcev/react-native-vanilla-js-starter/
This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.
I think this ticket is still important -- it would be good to ensure that react-native is easily usable without Typescript or babel in order to easily support other transpilers
This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.
This issue was closed because it has been stalled for 7 days with no activity.
This issue was closed because it has been stalled for 7 days with no activity.