This repository was archived by the owner on Sep 29, 2023. It is now read-only.
File tree 3 files changed +5
-4
lines changed
3 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -59,9 +59,9 @@ class Link extends React.PureComponent {
59
59
static contextTypes = { router : RouterContextPropType } ;
60
60
context : { router : RouterContextType } ;
61
61
props: Props ;
62
- ref: HTMLElement | null
62
+ ref: ? HTMLElement
63
63
64
- setRef = ( e : HTMLElement | null ) => {
64
+ setRef = ( e : ? HTMLElement ) => {
65
65
if ( e ) {
66
66
this . context . router . visibleRefProps . set ( e , this . _getCallbackProps ( ) ) ;
67
67
} else if ( this . ref ) {
Original file line number Diff line number Diff line change 2
2
import React , { Children , isValidElement } from 'react' ;
3
3
4
4
const childToString = ( child : Text | boolean | { } | null ) : string => {
5
- if ( typeof child === 'undefined' || child === null || typeof child === 'boolean' ) {
5
+ if ( ! child || typeof child === 'boolean' ) {
6
6
return '' ;
7
7
}
8
8
9
- return child . toString ( ) ;
9
+ return child . toString ( ) . replace ( '[object Object]' , '' ) ;
10
10
} ;
11
11
12
12
const hasChildren = ( element : React . Children ) : boolean =>
Original file line number Diff line number Diff line change @@ -55,6 +55,7 @@ export type LinkProps = {
55
55
trackingContext ?: ?Array < any >
56
56
} ;
57
57
58
+
58
59
export type LinkCallbackProps = {
59
60
location : Location ,
60
61
name : ?string ,
You can’t perform that action at this time.
0 commit comments