Skip to content

Commit b95cd8c

Browse files
authored
Export InputSpinner via forwardRef
This addresses the error: `Function components cannot be given refs.` that arises from using a ref with InputSpinner.
1 parent 3752e39 commit b95cd8c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import InputSpinner from "./InputSpinner";
33
import {getSkin} from "./Skins";
44

55
// Export
6-
export default (props) => {
6+
export default React.forwardRef((props, ref) => {
77
const skinProps = getSkin(props.skin, props);
88
const finalProps = {...props, ...skinProps};
9-
return <InputSpinner {...finalProps} />;
10-
};
9+
return <InputSpinner {...finalProps} ref={ref} />;
10+
});

0 commit comments

Comments
 (0)