This repo modified from https://github.com/cawfree/create-react-native-dapp. All credit goes to him for the react-native integration
npx create-react-native-app -t with-typescriptTypeScript is a superset of JavaScript which gives you static types and powerful tooling in Visual Studio Code including autocompletion and useful inline warnings for type errors.
- Install the CLI:
npm i -g expo-cli - Create a project:
npx create-react-native-app -t with-typescript cdinto the project
- Create a blank TypeScript config:
touch tsconfig.json - Run
expo startto automatically configure TypeScript - Rename files to TypeScript,
.tsxfor React components and.tsfor plain typescript files
💡 You can disable the TypeScript setup in Expo CLI with the environment variable
EXPO_NO_TYPESCRIPT_SETUP=1 expo start
When I created this project it threw an error and didn't load all the npm packages. So I used >npm install --legacy-peer-deps after this.
I modified the index.js file from const { default: App } = require("./frontend/App"); to const { default: App } = require("./App");
Then couldn't get this to run on expo only - it showed only the splashscreen doing this. However, it is running on the web or on ios emulator IF I use > expo run:ios
(Also treid removing the typescript dependency and running EXPO_NO_TYPESCRIPT_SETUP=1 expo start as mentioned above)