Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

path expo

//react native or expo
//1. open package.json
//(change myapp to whatever you want to, it can even be src.)
{
  "name": "myapp"
}
//2. update your tsconfig.json file
{
  "compilerOptions": {
     ...
     "baseUrl": "./",
     "paths": {
        "myapp/*": ["*"]
      },
     ...
  }
}
//3.In your.tsx file
import { MyThing } from 'myapp/MyThing';
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #path #expo
ADD COMMENT
Topic
Name
2+4 =