-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[typescript] add withRouter test, update ts to 3.0.3
- Loading branch information
Showing
4 changed files
with
32 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,9 @@ | ||
import * as React from 'react'; | ||
import WithRouterComponent from './WithRouterComponent'; | ||
|
||
const Component = () => <div />; | ||
const Component = () => ( | ||
<div> | ||
<WithRouterComponent /> | ||
</div> | ||
); | ||
export default Component; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { WithRouter, withRouter } from 'found'; | ||
import * as React from 'react'; | ||
|
||
export interface MyProps { | ||
foo?: boolean; | ||
} | ||
|
||
export default withRouter( | ||
class MyRoutedComponent extends React.Component<MyProps & WithRouter> { | ||
public render() { | ||
const { | ||
match: { location }, | ||
router, | ||
} = this.props; | ||
return ( | ||
<div> | ||
{location.pathname}, {router} | ||
</div> | ||
); | ||
} | ||
}, | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters