Check out example codes for "electron reload html". It will help you in understanding the concepts better.

Code Example 1

const {getCurrentWindow, globalShortcut} = require('electron').remote;

var reload = ()=>{

globalShortcut.register('F5', reload);
globalShortcut.register('CommandOrControl+R', reload);
// here is the fix bug #3778, if you know alternative ways, please write them
window.addEventListener('beforeunload', ()=>{
  globalShortcut.unregister('F5', reload);
  globalShortcut.unregister('CommandOrControl+R', reload);

Learn ReactJs, React Native from