Skip to content
This repository has been archived by the owner on May 20, 2021. It is now read-only.

Cannot style the Link component #5

Open
barnesheaton opened this issue Dec 5, 2018 · 4 comments · May be fixed by #6
Open

Cannot style the Link component #5

barnesheaton opened this issue Dec 5, 2018 · 4 comments · May be fixed by #6

Comments

@barnesheaton
Copy link

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
@zobeirhamid zobeirhamid linked a pull request Dec 6, 2018 that will close this issue
@jeevcat
Copy link

jeevcat commented Dec 29, 2018

I'm also facing this issue when trying to style via the class prop of the Link component.

@npomfret
Copy link

Same here using:

"@react-navigation/core": "^3.0.2",
"@react-navigation/web": "^1.0.0-alpha.7",

Is there a solution?

@clementmoine
Copy link

Facing the same issue, I created a PR (#12) that solves the problem passing all props to the anchor. Including style, className and every props you may set to the <Link />

@djstein
Copy link

djstein commented Sep 3, 2019

as a work around for now:

      <Link routeName="Home">
        <Text
          style={{
            color: 'white'
          }}
        >
          Home
        </Text>
      </Link>

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants