From 80b2d92eb78fdec87e69c2269670250dbae3ba96 Mon Sep 17 00:00:00 2001 From: David Bondy Date: Mon, 17 Apr 2023 16:28:24 -0600 Subject: [PATCH] support both hook style refs and class style hooks --- src/components/TextInput/baseTextInputPropTypes.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/TextInput/baseTextInputPropTypes.js b/src/components/TextInput/baseTextInputPropTypes.js index dfb90b61af98..367f1df1a627 100644 --- a/src/components/TextInput/baseTextInputPropTypes.js +++ b/src/components/TextInput/baseTextInputPropTypes.js @@ -47,7 +47,10 @@ const propTypes = { hideFocusedState: PropTypes.bool, /** Forward the inner ref */ - innerRef: PropTypes.func, + innerRef: PropTypes.oneOfType([ + PropTypes.func, + PropTypes.shape({current: PropTypes.instanceOf(Element)}), + ]), /** Maximum characters allowed */ maxLength: PropTypes.number,