web icon indicating copy to clipboard operation
web copied to clipboard

Add restProps to anchor

Open clementmoine opened this issue 6 years ago • 0 comments

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 https://github.com/react-navigation/react-navigation-web/issues/5 is solved with this PR

clementmoine avatar Feb 08 '19 14:02 clementmoine