-
Hello,
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 8 replies
-
Hello @Merynek, replacing the const Menu = ({ innerRef, ...props }: MenuProps) => {
const theRef = useRef<HTMLDivElement>(null);
const setRef = useCallback((ref) => {
theRef.current = ref;
innerRef(ref);
}, [innerRef]);
return <components.Menu {...props} innerRef={setRef} />
} |
Beta Was this translation helpful? Give feedback.
Hello @Merynek,
replacing the
innerRef
prop particularly on theMenu
component could break functionality.If you want/need to do this, you should still add the ref to the original
innerRef
prop.To do this you create a callback function which you set as the
innerRef
prop, in which you set both refs.