From 976ad7497f18f78b5562cfa1c7acf1873ae5e645 Mon Sep 17 00:00:00 2001 From: Dane Everitt Date: Sat, 7 Dec 2019 11:03:23 -0800 Subject: [PATCH] Don't trigger reloads when working with HMR --- resources/scripts/index.tsx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/resources/scripts/index.tsx b/resources/scripts/index.tsx index a39f33d8f..5b7643242 100644 --- a/resources/scripts/index.tsx +++ b/resources/scripts/index.tsx @@ -2,5 +2,13 @@ import React from 'react'; import ReactDOM from 'react-dom'; import App from '@/components/App'; import './i18n'; +import { setConfig } from 'react-hot-loader'; + +// Prevents page reloads while making component changes which +// also avoids triggering constant loading indicators all over +// the place in development. +// +// @see https://github.com/gaearon/react-hot-loader#hook-support +setConfig({ reloadHooks: false }); ReactDOM.render(, document.getElementById('app'));