From 423bcf07cd13eb49d1e18a0887d48965ca7b3a3b Mon Sep 17 00:00:00 2001 From: Alex Liu Date: Thu, 7 Sep 2023 16:15:15 +0800 Subject: [PATCH] refactor(query-core): remove `queryKey` check in production environment (#5969) --- packages/query-core/src/query.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/query-core/src/query.ts b/packages/query-core/src/query.ts index 8b8b5ecabd..3b3960e900 100644 --- a/packages/query-core/src/query.ts +++ b/packages/query-core/src/query.ts @@ -354,8 +354,8 @@ export class Query< } } - if (!Array.isArray(this.options.queryKey)) { - if (process.env.NODE_ENV !== 'production') { + if (process.env.NODE_ENV !== 'production') { + if (!Array.isArray(this.options.queryKey)) { this.logger.error( `As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']`, )