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

Conversation

@clementmoine
Copy link

@clementmoine clementmoine commented Feb 8, 2019

The user is able to provide style, onClick and className parameters for example when creating a Link from react-navigation-web.

restProps is meant to contain all props that are not already extracted from this.props that allow the user to choose wether he want to add className, onClick, style for any reason.

Use case example :

import React, { Component } from 'react'
import { Link } from '@react-navigation/web'

class example extends Component {
  render() {
    return (
      <Link
        className="my-classname"
        routeName="MyPage"
        style={{ anyStyleProperty: 'anyValue' }}
      >
        <span>Some text</span>
      </Link>
    )
  }
}

export default example

Issue #5 is solved with this PR

Add the restProps to anchor to allow params like `style`, `className` and many more !
routeKey,
navigation,
action,
...restProps,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if we renamed this to anchorProps, (with no "..." spreading) so that the use is explicit. I want to make sure we can add functionality to this component in the future, without breaking people's apps. This way we don't have the same namespace as the component

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 this pull request may close these issues.

2 participants