web
web copied to clipboard
Add restProps to anchor
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