Skip to content

Commit 328d793

Browse files
theKasheygregberge
authored andcommitted
fix: break cyclic dependency (#822)
Fixes #820
1 parent 2f2e01f commit 328d793

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

Diff for: packages/react-hot-loader/src/reconciler/proxies.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
1-
import createProxy, { setConfig } from 'react-stand-in'
2-
import logger from '../logger'
1+
import createProxy from 'react-stand-in'
32

43
let proxiesByID
54
let idsByType
65

76
let elementCount = 0
87

9-
setConfig({ logger })
10-
118
const generateTypeId = () => `auto-${elementCount++}`
129

1310
export const getIdByType = type => idsByType.get(type)

Diff for: packages/react-hot-loader/src/utils.dev.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import { getProxyByType } from './reconciler/proxies'
22
import reactHotLoader from './reactHotLoader'
3+
import logger from './logger'
4+
import { setConfig as setProxyConfig } from 'react-stand-in'
5+
6+
setProxyConfig({ logger })
37

48
export const areComponentsEqual = (a, b) =>
59
getProxyByType(a) === getProxyByType(b)
610

7-
export const setConfig = config => {
8-
Object.assign(reactHotLoader.config, config)
9-
}
11+
export const setConfig = config => Object.assign(reactHotLoader.config, config)

0 commit comments

Comments
 (0)