albefoxs
albefoxs

Reputation: 81

how to implement reload app in react native expo (production)

I tried to create restart with react-native-restart, but I get an error when calling RNRestart.Restart():

[Unhandled promise rejection: TypeError: null is not an object (evaluating '_reactNativeRestart.default.Restart')]

How do I implement reload in production ?

p.s. I use expo

Upvotes: 8

Views: 11565

Answers (2)

Othmane elkhiari
Othmane elkhiari

Reputation: 91

import { reloadAppAsync } from "expo";
reloadAppAsync()

Upvotes: 7

Brandonjgs
Brandonjgs

Reputation: 382

you can use expo-updates just run expo install expo-updates and restart the app with the method reloadAsync

import * as Updates from 'expo-updates';
Updates.reloadAsync()

Upvotes: 15

Related Questions