Skip to content

Commit ad3de53

Browse files
alireza-mhtimdorr
authored andcommitted
Refactor - Link.js - {...props} to {...rest} (remix-run#6406)
1 parent 2da6f10 commit ad3de53

File tree

1 file changed

+4
-3
lines changed
  • packages/react-router-dom/modules

1 file changed

+4
-3
lines changed

packages/react-router-dom/modules/Link.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class Link extends React.Component {
3636
}
3737

3838
render() {
39-
const { innerRef, replace, to, ...props } = this.props; // eslint-disable-line no-unused-vars
39+
const { innerRef, replace, to, ...rest } = this.props; // eslint-disable-line no-unused-vars
4040

4141
return (
4242
<RouterContext.Consumer>
@@ -51,7 +51,7 @@ class Link extends React.Component {
5151

5252
return (
5353
<a
54-
{...props}
54+
{...rest}
5555
onClick={event => this.handleClick(event, context)}
5656
href={href}
5757
ref={innerRef}
@@ -65,9 +65,10 @@ class Link extends React.Component {
6565

6666
if (__DEV__) {
6767
const toType = PropTypes.oneOfType([PropTypes.string, PropTypes.object]);
68+
const innerRefType = PropTypes.oneOfType([PropTypes.string, PropTypes.func]);
6869

6970
Link.propTypes = {
70-
innerRef: PropTypes.oneOfType([PropTypes.string, PropTypes.func]),
71+
innerRef: innerRefType,
7172
onClick: PropTypes.func,
7273
replace: PropTypes.bool,
7374
target: PropTypes.string,

0 commit comments

Comments
 (0)