Skip to content
This repository was archived by the owner on Sep 29, 2023. It is now read-only.

Commit 8f87f1e

Browse files
committed
Review comments
1 parent e025d10 commit 8f87f1e

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

src/components/Link/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ class Link extends React.PureComponent {
5959
static contextTypes = {router: RouterContextPropType};
6060
context: {router: RouterContextType};
6161
props: Props;
62-
ref: HTMLElement | null
62+
ref: ?HTMLElement
6363

64-
setRef = (e: HTMLElement | null) => {
64+
setRef = (e: ?HTMLElement) => {
6565
if (e) {
6666
this.context.router.visibleRefProps.set(e, this._getCallbackProps());
6767
} else if (this.ref) {

src/components/Link/utils.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
import React, {Children, isValidElement} from 'react';
33

44
const childToString = (child: Text | boolean | {} | null): string => {
5-
if (typeof child === 'undefined' || child === null || typeof child === 'boolean') {
5+
if (!child || typeof child === 'boolean') {
66
return '';
77
}
88

9-
return child.toString();
9+
return child.toString().replace('[object Object]', '');
1010
};
1111

1212
const hasChildren = (element: React.Children): boolean =>

src/types.js

+1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ export type LinkProps = {
5555
trackingContext?: ?Array<any>
5656
};
5757

58+
5859
export type LinkCallbackProps = {
5960
location: Location,
6061
name: ?string,

0 commit comments

Comments
 (0)