From fb650a86962bf1fd7f32de347d5fa89f1f52d96d Mon Sep 17 00:00:00 2001 From: David Wheatley Date: Tue, 28 Dec 2021 20:51:13 +0100 Subject: [PATCH] fix: don't fire deprecation warnings for Mithril-originating action (#3236) * fix: don't fire deprecation warnings for Mithril-originating actions * Add comment --- framework/core/js/src/forum/components/Search.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/framework/core/js/src/forum/components/Search.tsx b/framework/core/js/src/forum/components/Search.tsx index 054c0b307..471e39322 100644 --- a/framework/core/js/src/forum/components/Search.tsx +++ b/framework/core/js/src/forum/components/Search.tsx @@ -76,7 +76,9 @@ export default class Search extends Compone return this.searchState; } protected set state(state: SearchState) { - fireDeprecationWarning('`state` property of the Search component is deprecated', '3212'); + // Workaround to prevent triggering deprecation warnings due to Mithril + // setting state to undefined when creating components + state !== undefined && fireDeprecationWarning('`state` property of the Search component is deprecated', '3212'); this.searchState = state; }