fix: don't fire deprecation warnings for Mithril-originating action (#3236)

* fix: don't fire deprecation warnings for Mithril-originating actions

* Add comment
This commit is contained in:
David Wheatley 2021-12-28 20:51:13 +01:00 committed by GitHub
parent 4b25b90b48
commit 94f9e7f9de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -76,7 +76,9 @@ export default class Search<T extends SearchAttrs = SearchAttrs> 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;
}