From 8d17b557b2844941270778e9b296b07d7a2508cc Mon Sep 17 00:00:00 2001 From: Renato Alves <19148962+renatonascalves@users.noreply.github.com> Date: Fri, 13 Oct 2023 09:45:38 -0300 Subject: [PATCH 1/2] Add keys when rendering lists --- blocks/query/edit.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/blocks/query/edit.tsx b/blocks/query/edit.tsx index 35295c28..21dccd78 100644 --- a/blocks/query/edit.tsx +++ b/blocks/query/edit.tsx @@ -11,7 +11,7 @@ import { TextControl, } from '@wordpress/components'; import { useSelect } from '@wordpress/data'; -import { createInterpolateElement, useEffect, useState } from '@wordpress/element'; +import { Fragment, createInterpolateElement, useEffect, useState } from '@wordpress/element'; import { __, sprintf } from '@wordpress/i18n'; import { addQueryArgs } from '@wordpress/url'; @@ -341,6 +341,7 @@ export default function Edit({ 'manual-posts__container', { 'manual-posts__container--selected': manualPosts[index] }, )} + key={index} > {index + 1} {Object.keys(availableTaxonomies).length > 0 ? ( allowedTaxonomies.map((taxonomy) => ( - <> + { /* @ts-ignore */ } setTerms(taxonomy, newCategories)} multiple /> - + )) ) : null} { /* @ts-ignore */ } From 07af170fd2ea6642c7f9f4b5fa15922d71ed4c8c Mon Sep 17 00:00:00 2001 From: Renato Alves <19148962+renatonascalves@users.noreply.github.com> Date: Fri, 13 Oct 2023 22:12:01 -0300 Subject: [PATCH 2/2] Update blocks/query/edit.tsx Co-authored-by: Kaitlin Bolling --- blocks/query/edit.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/blocks/query/edit.tsx b/blocks/query/edit.tsx index 21dccd78..f7daaf51 100644 --- a/blocks/query/edit.tsx +++ b/blocks/query/edit.tsx @@ -11,7 +11,12 @@ import { TextControl, } from '@wordpress/components'; import { useSelect } from '@wordpress/data'; -import { Fragment, createInterpolateElement, useEffect, useState } from '@wordpress/element'; +import { + Fragment, + createInterpolateElement, + useEffect, + useState, +} from '@wordpress/element'; import { __, sprintf } from '@wordpress/i18n'; import { addQueryArgs } from '@wordpress/url';