how to add json animation file to app.json in react native expo

331 views Asked by At

since expo doesn't support gif images as splashscreen, i am trying to use gif as json a file. Is it possible to use json file in app.json. If yes, how? Any help would be appreciated.

1

There are 1 answers

1
Jonas Beck On

Yes, you can place json file in your project and use it by importing from the relative path.

import animation from './animation.json';//if the json file exists in the same folder

In the case your project is typescript based you should add "resolveJsonModule": true into "compilerOptions" in tsconfig.json file.

{
 "compilerOptions": {
  //...
  "resolveJsonModule": true,
  //...
 }
}