Skip to content

Commit ef0817c

Browse files
committed
refactor: remove HMR relative code
BREAKING CHANGE: `setConfig` is no longer available.
1 parent fff1248 commit ef0817c

File tree

5 files changed

+1
-32
lines changed

5 files changed

+1
-32
lines changed

README.md

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -342,14 +342,7 @@ window.snapSaveState = () => getState()
342342

343343
### Hot Reloading
344344

345-
Loadable Components is Hot Reload friendly, it works out of the box with [React Hot Loader](https://github.com/gaearon/react-hot-loader) without adding a single line of code. All components are loaded when a reload occurs, if you want to disable this behaviour, you can set a global config:
346-
347-
```js
348-
import { setConfig } from 'loadable-components'
349-
350-
// Disable automatic "load" of components
351-
setConfig({ hotReload: false })
352-
```
345+
Loadable Components is Hot Reload friendly, it works out of the box with [React Hot Loader](https://github.com/gaearon/react-hot-loader).
353346

354347
## API Reference
355348

src/config.js

Lines changed: 0 additions & 9 deletions
This file was deleted.

src/config.test.js

Lines changed: 0 additions & 9 deletions
This file was deleted.

src/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,4 @@ export { default as loadComponents } from './loadComponents'
44
export { default as getState } from './getState'
55
export { LOADABLE } from './constants'
66
export { default } from './loadable'
7-
export { setConfig } from './config'
87
export const componentTracker = tracker

src/loadable.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import hoistNonReactStatics from 'hoist-non-react-statics'
44
import { LOADABLE } from './constants'
55
import resolveModuleDefault from './utils/resolveModuleDefault'
66
import * as componentTracker from './componentTracker'
7-
import { getConfig } from './config'
87

98
const EmptyComponent = () => null
109

@@ -107,10 +106,6 @@ function loadable(
107106

108107
LoadableComponent[LOADABLE] = () => LoadableComponent
109108

110-
if (module && module.hot && getConfig().hotReload) {
111-
LoadableComponent.load()
112-
}
113-
114109
if (modules) {
115110
const id = componentTracker.track(LoadableComponent, modules)
116111
LoadableComponent.componentId = id

0 commit comments

Comments
 (0)