From 6a4ca99e1e825f0275ae6dff3add31b8bda07fd8 Mon Sep 17 00:00:00 2001 From: silverwind Date: Fri, 17 Apr 2020 13:54:10 +0200 Subject: [PATCH] Use PropTypes.elementType to support wrapped components Components wrapped in `forwardRef`do not identify as a function but as a object. Use PropTypes.elementType to allow those as well. Fixes: https://github.com/yury-dymov/react-autocomplete-input/issues/40 --- package.json | 2 +- src/AutoCompleteTextField.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 1c0ef6c..e1fb375 100644 --- a/package.json +++ b/package.json @@ -60,7 +60,7 @@ }, "dependencies": { "get-input-selection": "^1.1.4", - "prop-types": "^15.6.2", + "prop-types": "^15.7.2", "textarea-caret": "^3.0.2" }, "peerDependencies": { diff --git a/src/AutoCompleteTextField.js b/src/AutoCompleteTextField.js index fbd6922..80e33fe 100644 --- a/src/AutoCompleteTextField.js +++ b/src/AutoCompleteTextField.js @@ -17,7 +17,7 @@ const OPTION_LIST_MIN_WIDTH = 100; const propTypes = { Component: PropTypes.oneOfType([ PropTypes.string, - PropTypes.func, + PropTypes.elementType, ]), defaultValue: PropTypes.string, disabled: PropTypes.bool,