Fix dataSet for noFeedback links (#8745)
* fix dataSet for noFeedback links * rm memo * rm useless spread
This commit is contained in:
committed by
Austin McKinley
parent
facb7a000e
commit
f8d3bdd796
@@ -101,13 +101,9 @@ export const Link = memo(function Link({
|
||||
{name: 'activate', label: title},
|
||||
]
|
||||
|
||||
const dataSet = useMemo(() => {
|
||||
const ds = {...dataSetProp}
|
||||
if (anchorNoUnderline) {
|
||||
ds.noUnderline = 1
|
||||
}
|
||||
return ds
|
||||
}, [dataSetProp, anchorNoUnderline])
|
||||
const dataSet = anchorNoUnderline
|
||||
? {...dataSetProp, noUnderline: 1}
|
||||
: dataSetProp
|
||||
|
||||
if (noFeedback) {
|
||||
return (
|
||||
@@ -125,6 +121,8 @@ export const Link = memo(function Link({
|
||||
onAccessibilityAction?.(e)
|
||||
}
|
||||
}}
|
||||
// @ts-ignore web only -sfn
|
||||
dataSet={dataSet}
|
||||
{...props}
|
||||
android_ripple={{
|
||||
color: t.atoms.bg_contrast_25.backgroundColor,
|
||||
@@ -198,13 +196,9 @@ export const TextLink = memo(function TextLink({
|
||||
console.error('Unable to detect mismatching label')
|
||||
}
|
||||
|
||||
const dataSet = useMemo(() => {
|
||||
const ds = {...dataSetProp}
|
||||
if (anchorNoUnderline) {
|
||||
ds.noUnderline = 1
|
||||
}
|
||||
return ds
|
||||
}, [dataSetProp, anchorNoUnderline])
|
||||
const dataSet = anchorNoUnderline
|
||||
? {...dataSetProp, noUnderline: 1}
|
||||
: dataSetProp
|
||||
|
||||
const onPress = useCallback(
|
||||
(e?: Event) => {
|
||||
|
||||
Reference in New Issue
Block a user