From c072c025b9321384805a92898b63c77cd2395e70 Mon Sep 17 00:00:00 2001 From: Miklos Bertalan Date: Wed, 6 Feb 2019 10:43:07 +0100 Subject: [PATCH] fix view setState bailout --- src/view.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/view.js b/src/view.js index e8eaa65..163a512 100644 --- a/src/view.js +++ b/src/view.js @@ -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) @@ -22,7 +21,7 @@ export default function view(Comp) { const render = useMemo( () => observe(Comp, { - scheduler: () => setState(DUMMY_STATE), + scheduler: () => setState({}), lazy: true }), [] @@ -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 }) }