From 5a06a41a0a3b9e8b37e9b1a0a1557661416ec46e Mon Sep 17 00:00:00 2001 From: turtletongue Date: Thu, 1 Jun 2023 13:52:07 +0500 Subject: [PATCH] fix: replace react default props with default parameters --- .../src/withAsyncPaginate.tsx | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/packages/react-select-async-paginate/src/withAsyncPaginate.tsx b/packages/react-select-async-paginate/src/withAsyncPaginate.tsx index 2733e2b..74eceae 100644 --- a/packages/react-select-async-paginate/src/withAsyncPaginate.tsx +++ b/packages/react-select-async-paginate/src/withAsyncPaginate.tsx @@ -40,10 +40,10 @@ export function withAsyncPaginate( IsMulti extends boolean = false, >(props: AsyncPaginateProps): ReactElement { const { - components, - selectRef, + components = {}, + selectRef = null, isLoading: isLoadingProp, - cacheUniqs, + cacheUniqs = [], ...rest } = props; @@ -69,11 +69,5 @@ export function withAsyncPaginate( ); } - WithAsyncPaginate.defaultProps = { - selectRef: null, - cacheUniqs: [], - components: {}, - }; - return WithAsyncPaginate; }