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

Cannot style the Link component #5

Open

Description

@barnesheaton

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

Activity

  1. jeevcat commented on Dec 29, 2018

    @jeevcat

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

  2. npomfret commented on Jan 18, 2019

    @npomfret

    Same here using:

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

    Is there a solution?

  3. clementmoine commented on Feb 8, 2019

    @clementmoine

    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 />

  4. djstein commented on Sep 3, 2019

    @djstein

    as a work around for now:

          <Link routeName="Home">
            <Text
              style={{
                color: 'white'
              }}
            >
              Home
            </Text>
          </Link>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions