Skip to content

DeveloperAlly/react-native-dapp

Repository files navigation

This repo modified from https://github.com/cawfree/create-react-native-dapp. All credit goes to him for the react-native integration

TypeScript Example

Supports Expo iOS Supports Expo Android Supports Expo Web

npx create-react-native-app -t with-typescript

TypeScript 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.

🚀 How to use

Creating a new project

  • Install the CLI: npm i -g expo-cli
  • Create a project: npx create-react-native-app -t with-typescript
  • cd into the project

Adding TypeScript to existing projects

  • Create a blank TypeScript config: touch tsconfig.json
  • Run expo start to automatically configure TypeScript
  • Rename files to TypeScript, .tsx for React components and .ts for plain typescript files

💡 You can disable the TypeScript setup in Expo CLI with the environment variable EXPO_NO_TYPESCRIPT_SETUP=1 expo start

📝 Notes

Ally's readme

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)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors