mirror of
https://github.com/nextui-org/nextui.git
synced 2025-12-08 19:26:11 +00:00
Chore(Link): Remove code redundancies (#1111)
This commit is contained in:
parent
8b324d3943
commit
5b9d85e098
@ -64,9 +64,13 @@ export function useLink(originalProps: UseLinkProps) {
|
|||||||
otherProps.target = otherProps.target ?? "_blank";
|
otherProps.target = otherProps.target ?? "_blank";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (as !== "a") {
|
/**
|
||||||
otherProps.role = "link";
|
* if (as !== "a") {
|
||||||
}
|
* otherProps.role = "link";
|
||||||
|
* }
|
||||||
|
* This logic handled by @react-aria/link.
|
||||||
|
* See: https://github.com/adobe/react-spectrum/blob/5a3315f560071087cacf846bd2a86d8f47692446/packages/%40react-aria/link/src/useLink.ts#L55
|
||||||
|
*/
|
||||||
|
|
||||||
const classNames = useMemo(
|
const classNames = useMemo(
|
||||||
() =>
|
() =>
|
||||||
@ -87,7 +91,7 @@ export function useLink(originalProps: UseLinkProps) {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
return {Component, children, anchorIcon, linkProps, showAnchorIcon, getLinkProps};
|
return {Component, children, anchorIcon, showAnchorIcon, getLinkProps};
|
||||||
}
|
}
|
||||||
|
|
||||||
export type UseLinkReturn = ReturnType<typeof useLink>;
|
export type UseLinkReturn = ReturnType<typeof useLink>;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user