From b95cd8cbdd803462314c0b5d6b7f1994166f16f5 Mon Sep 17 00:00:00 2001 From: Akin Williams Date: Thu, 16 Feb 2023 10:05:49 -0500 Subject: [PATCH] Export InputSpinner via forwardRef This addresses the error: `Function components cannot be given refs.` that arises from using a ref with InputSpinner. --- src/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/index.js b/src/index.js index 290cd35..7e2b6b9 100644 --- a/src/index.js +++ b/src/index.js @@ -3,8 +3,8 @@ import InputSpinner from "./InputSpinner"; import {getSkin} from "./Skins"; // Export -export default (props) => { +export default React.forwardRef((props, ref) => { const skinProps = getSkin(props.skin, props); const finalProps = {...props, ...skinProps}; - return ; -}; + return ; +});