Skip to content

Commit c072c02

Browse files
committed
fix view setState bailout
1 parent 12385e3 commit c072c02

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/view.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { hasHooks } from './utils'
44

55
export let isInsideFunctionComponent = false
66
const COMPONENT = Symbol('owner component')
7-
const DUMMY_STATE = {}
87

98
export default function view(Comp) {
109
const isStatelessComp = !(Comp.prototype && Comp.prototype.isReactComponent)
@@ -22,7 +21,7 @@ export default function view(Comp) {
2221
const render = useMemo(
2322
() =>
2423
observe(Comp, {
25-
scheduler: () => setState(DUMMY_STATE),
24+
scheduler: () => setState({}),
2625
lazy: true
2726
}),
2827
[]
@@ -56,7 +55,7 @@ export default function view(Comp) {
5655

5756
// create a reactive render for the component
5857
this.render = observe(this.render, {
59-
scheduler: () => this.setState(DUMMY_STATE),
58+
scheduler: () => this.setState({}),
6059
lazy: true
6160
})
6261
}

0 commit comments

Comments
 (0)