Cannot style the Link component
Current Behavior
Adding a style prop to a Link does not change the style of the Link
import { Link } from '@react-navigation/web'
<Link routeName="Landing" style={{ textDecoration: 'none' }}>
<PrimaryButton title={'◀︎ Back to Home'} style={styles.button} />
</Link>
Expected Behavior
The child components should not be underlined (or textDecorated)
How to reproduce
I believe the same issue is reproduced here? https://github.com/react-navigation/web-server-example/blob/master/src/AppView.js
Your Environment
| software | version |
|---|---|
| @react-navigation/web | 1.0.0-alpha.7 |
| react-native-web | 0.5.4 |
| node | 9.11.2 |
| yarn | 1.7.0 |
I'm also facing this issue when trying to style via the class prop of the Link component.
Same here using:
"@react-navigation/core": "^3.0.2",
"@react-navigation/web": "^1.0.0-alpha.7",
Is there a solution?
Facing the same issue, I created a PR (https://github.com/react-navigation/react-navigation-web/pull/12) that solves the problem passing all props to the anchor. Including style, className and every props you may set to the <Link />
as a work around for now:
<Link routeName="Home">
<Text
style={{
color: 'white'
}}
>
Home
</Text>
</Link>