Last active
October 16, 2024 17:26
-
-
Save nderscore/6c5bdd04b844414c73b9e41a738556dc to your computer and use it in GitHub Desktop.
Example Tamagui Solito Text Link
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { forwardRef } from 'react'; | |
import { LinkCore, LinkCoreProps } from 'solito/link'; | |
import { AnchorProps, styled, Anchor } from 'tamagui'; | |
const StyledTextLink = styled(Anchor, { | |
name: 'TextLink', | |
}); | |
export type TextLinkProps = Pick<LinkCoreProps, 'href' | 'target'> & | |
AnchorProps; | |
export const TextLink = StyledTextLink.styleable( | |
({ children, href, target, ...restProps }, ref) => { | |
return ( | |
<LinkCore | |
Component={StyledTextLink} | |
componentProps={restProps} | |
href={href} | |
ref={ref} | |
target={target} | |
> | |
{children} | |
</LinkCore> | |
); | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I've been using the solito image component raw with its default styles 🤐
For most styling, a wrapper view along with the
fill
+resizeMode
props usually suffices.