Skip to content

Commit f52d59c

Browse files
committed
stable
1 parent b6c1d9b commit f52d59c

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

src/internal/stack/hydrateFiberStack.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
/* eslint-disable no-underscore-dangle */
22
import ReactDOM from 'react-dom'
33

4-
const hotRenderWithHooks = ReactDOM.hotRenderWithHooks || (() => null)
4+
const hotRenderWithHooks =
5+
ReactDOM.hotRenderWithHooks || ((fiber, render) => render())
56

67
function pushStack(stack, node) {
78
stack.type = node.type
@@ -14,9 +15,8 @@ function pushStack(stack, node) {
1415
stack.instance = {
1516
SFC_fake: stack.type,
1617
props: {},
17-
render: () => {
18-
hotRenderWithHooks(node, () => stack.type(stack.instance.props))
19-
},
18+
render: () =>
19+
hotRenderWithHooks(node, () => stack.type(stack.instance.props)),
2020
}
2121
}
2222
}

src/proxy/createClassProxy.js

+2
Original file line numberDiff line numberDiff line change
@@ -220,11 +220,13 @@ function createClassProxy(InitialComponent, proxyKey, options = {}) {
220220
result = CurrentComponent(this.props, this.context)
221221
} else {
222222
const renderMethod = CurrentComponent.prototype.render || this.render
223+
/* eslint-disable no-use-before-define */
223224
if (renderMethod === proxiedRender) {
224225
throw new Error(
225226
'React-Hot-Loader: you are trying to render Component without .render method',
226227
)
227228
}
229+
/* eslint-enable */
228230
result = renderMethod.apply(
229231
this,
230232
// eslint-disable-next-line prefer-rest-params

test/reconciler.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ describe('reconciler', () => {
120120
currentProps.newProp = true
121121
incrementGeneration()
122122
wrapper.setProps({ update: 'now' })
123-
// not react-stand-in merge them together
123+
// now react-stand-in merge them together
124124
expect(areComponentsEqual(first.Component, second.Component)).toBe(true)
125125
expect(wrapper.find(<first.Component />.type).length).toBe(1)
126126
expect(wrapper.find(<second.Component />.type).length).toBe(1)

0 commit comments

Comments
 (0)