Merge pull request #521 from lowdefy/renderer-race-condition

fix(renderer): List render race condition, closes #520
This commit is contained in:
Gervwyk 2021-03-26 14:22:40 +02:00 committed by GitHub
commit 0e82467443
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 3 deletions

View File

@ -14,7 +14,7 @@
limitations under the License.
*/
import React, { Suspense, useEffect, useState } from 'react';
import React, { Suspense, useState } from 'react';
import { ErrorBoundary } from '@lowdefy/block-tools';

View File

@ -24,6 +24,7 @@ import Context from './Context';
import List from './List';
const CategorySwitch = ({ block, Blocks, Component, context, lowdefy }) => {
if (!block.eval) return null; // Renderer updates before eval is executed for the first time on lists. See #520
if (block.eval.visible === false)
return <div id={`vs-${block.blockId}`} style={{ display: 'none' }} />;
@ -34,8 +35,6 @@ const CategorySwitch = ({ block, Blocks, Component, context, lowdefy }) => {
block={block}
context={context}
contextId={makeContextId({
// TODO: remove branch
branch: 'main',
urlQuery: lowdefy.urlQuery,
pageId: lowdefy.pageId,
blockId: block.blockId,