Skip to content

Commit

Permalink
fix view setState bailout
Browse files Browse the repository at this point in the history
  • Loading branch information
solkimicreb committed Feb 6, 2019
1 parent 12385e3 commit c072c02
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { hasHooks } from './utils'

export let isInsideFunctionComponent = false
const COMPONENT = Symbol('owner component')
const DUMMY_STATE = {}

export default function view(Comp) {
const isStatelessComp = !(Comp.prototype && Comp.prototype.isReactComponent)
Expand All @@ -22,7 +21,7 @@ export default function view(Comp) {
const render = useMemo(
() =>
observe(Comp, {
scheduler: () => setState(DUMMY_STATE),
scheduler: () => setState({}),
lazy: true
}),
[]
Expand Down Expand Up @@ -56,7 +55,7 @@ export default function view(Comp) {

// create a reactive render for the component
this.render = observe(this.render, {
scheduler: () => this.setState(DUMMY_STATE),
scheduler: () => this.setState({}),
lazy: true
})
}
Expand Down

0 comments on commit c072c02

Please sign in to comment.