Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export const Tab = forwardRef(function Tab(
{ children, as: Comp = "button", ...rest },
forwardedRef
) {
const { isSelected, _userInteractedRef, _onSelect, _id, ...htmlProps } = rest;
const htmlType =
Comp === "button" && htmlProps.type == null ? "button" : undefined;
const ownRef = useRef(null);
const ref = useForkedRef(forwardedRef, ownRef);
useUpdateEffect(() => {
if (isSelected && ownRef.current && _userInteractedRef.current) {
_userInteractedRef.current = false;
ownRef.current.focus();
}
}, [isSelected]);
return (