Reputation: 31
I am looking at implementing my web application as a PWA using React. The main feature that I want to implement is to cache JSON data fetched from API such that it works in offline mode. However, I do not know how to code the service worker in React.
Upvotes: 0
Views: 1093
Reputation: 725
You can start reading the official doc here and you should figure out how you must configure your environment (webpack). If you could not understand it, you shoud read this medium article here or here.
You need to:
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
Upvotes: 1