What does registerServiceWorker do in React JS?

前端 未结 2 461
暗喜
暗喜 2020-12-07 18:41

I\'m a newbie in React and I was wondering what is the purpose of registerServiceWorker() in the following code?

import React from \'react\';
import ReactDOM         


        
2条回答
  •  伪装坚强ぢ
    2020-12-07 18:55

    The service worker is to use the website data offline in case there is no network, it's like making PWA. Refer to this link PWA to know more about implementation and how to use registerServiceWorker().

提交回复
热议问题