-1

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.

2 Answers 2

0

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, //... } } 
Sign up to request clarification or add additional context in comments.

1 Comment

since expo uses app.json file for splash screen, how can i import json file in app.json, i tried replacing existing png image with json file and applied your changes, still it is giving blank white screen in place of splash screen
0

you should use some react-native packages such as Lottie or Skottie . but I do recommend using Lottie on Expo Duo to the many many many errors with Skottie. but if you want to use it on React-Native CLI I personally prefer Skottie. cause it's way more efficient and handles performance a lot smoother

YOUR CALL

Skottie => npm i react-native-skottie

or

Lottie => npm i lottie-react-native

Happy Coding

Comments