Answer a question

I'm working on a task where I have to update a product images. Expo cache is posing a problem, when I update the product images and re-render the screen it does update my store state but doesn't show it. When I manually cleared expo cache it did work.

I have also tried using the 'Cache-Control' header, but that didn't solve the problem.

Is there a method I can call to clear expo cache ?

Answers

As far as I know the only way to clear Expo's cache is to add the -c flag to your expo start command.

Here's their page on useful commands:

  • expo start -c --localhost --ios

    • start expo server, clear cache, load only on localhost and open on iOS simulator

I don't think there's a method in their SDK that clears the cache while the app is running like you want to.

Logo

React社区为您提供最前沿的新闻资讯和知识内容

更多推荐