From f07b811e3a104731a2e17f660555c7ec60275c62 Mon Sep 17 00:00:00 2001 From: Haroen Viaene Date: Thu, 12 Aug 2021 10:20:11 +0200 Subject: [PATCH] use elementType https://github.com/facebook/prop-types/pull/211 https://github.com/facebook/react/issues/5143#issuecomment-509633000 --- packages/react-instantsearch-dom/src/components/Hits.tsx | 6 +----- .../react-instantsearch-dom/src/components/InfiniteHits.js | 6 +----- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/packages/react-instantsearch-dom/src/components/Hits.tsx b/packages/react-instantsearch-dom/src/components/Hits.tsx index b7e6d2158b..f7b9e33b76 100644 --- a/packages/react-instantsearch-dom/src/components/Hits.tsx +++ b/packages/react-instantsearch-dom/src/components/Hits.tsx @@ -57,11 +57,7 @@ const HitPropTypes = PropTypes.shape({ Hits.propTypes = { hits: PropTypes.arrayOf(HitPropTypes.isRequired).isRequired, className: PropTypes.string, - hitComponent: PropTypes.oneOfType([ - PropTypes.string, - PropTypes.func, - PropTypes.object, - ]), + hitComponent: PropTypes.elementType, }; export default Hits; diff --git a/packages/react-instantsearch-dom/src/components/InfiniteHits.js b/packages/react-instantsearch-dom/src/components/InfiniteHits.js index 874a77da10..e4574026f7 100644 --- a/packages/react-instantsearch-dom/src/components/InfiniteHits.js +++ b/packages/react-instantsearch-dom/src/components/InfiniteHits.js @@ -62,11 +62,7 @@ InfiniteHits.propTypes = { refineNext: PropTypes.func.isRequired, translate: PropTypes.func.isRequired, className: PropTypes.string, - hitComponent: PropTypes.oneOfType([ - PropTypes.string, - PropTypes.func, - PropTypes.object, - ]), + hitComponent: PropTypes.elementType, }; InfiniteHits.defaultProps = {