diff --git a/mangle.json b/mangle.json index e1731b4953..8c776e35fa 100644 --- a/mangle.json +++ b/mangle.json @@ -74,7 +74,6 @@ "$_unmount": "__u", "$_owner": "__o", "$_skipEffects": "__s", - "$_rerenderCount": "__r", "$_forwarded": "__f", "$_isSuspended": "__i", "$_bits": "__g" diff --git a/src/component.js b/src/component.js index 99d6b308a1..639a377c5c 100644 --- a/src/component.js +++ b/src/component.js @@ -195,7 +195,12 @@ let rerenderQueue = []; * * [Callbacks synchronous and asynchronous](https://blog.ometer.com/2011/07/24/callbacks-synchronous-and-asynchronous/) */ -let prevDebounce; +let prevDebounce, + rerenderCount = 0; + +export function resetRenderCount() { + rerenderCount = 0; +} /** * Enqueue a rerender of a component @@ -206,7 +211,7 @@ export function enqueueRender(c) { (!(c._bits & COMPONENT_DIRTY) && (c._bits |= COMPONENT_DIRTY) && rerenderQueue.push(c) && - !process._rerenderCount++) || + !rerenderCount++) || prevDebounce != options.debounceRendering ) { prevDebounce = options.debounceRendering; @@ -245,7 +250,6 @@ function process() { renderComponent(c); } } - process._rerenderCount = 0; -} -process._rerenderCount = 0; + rerenderCount = 0; +} diff --git a/src/diff/catch-error.js b/src/diff/catch-error.js index c7f4123445..28325631fc 100644 --- a/src/diff/catch-error.js +++ b/src/diff/catch-error.js @@ -1,3 +1,4 @@ +import { resetRenderCount } from '../component'; import { NULL, COMPONENT_DIRTY, @@ -51,5 +52,8 @@ export function _catchError(error, vnode, oldVNode, errorInfo) { } } + // Reset rerender count to 0, so that the next render will not be skipped + // when we leverage prefresh + resetRenderCount(); throw error; }