Skip to content

Commit 976ad74

Browse files
committed
Don't trigger reloads when working with HMR
1 parent ed50259 commit 976ad74

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

resources/scripts/index.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,13 @@ import React from 'react';
22
import ReactDOM from 'react-dom';
33
import App from '@/components/App';
44
import './i18n';
5+
import { setConfig } from 'react-hot-loader';
6+
7+
// Prevents page reloads while making component changes which
8+
// also avoids triggering constant loading indicators all over
9+
// the place in development.
10+
//
11+
// @see https://github.com/gaearon/react-hot-loader#hook-support
12+
setConfig({ reloadHooks: false });
513

614
ReactDOM.render(<App/>, document.getElementById('app'));

0 commit comments

Comments
 (0)