mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
Fix type to use correct NavLinkProps
This commit is contained in:
parent
e63f331400
commit
36eb56cdf2
@ -1,9 +1,9 @@
|
||||
import { ComponentClass } from "react";
|
||||
import { LinkProps } from "react-router-dom";
|
||||
import { NavLinkProps } from "react-router-dom";
|
||||
|
||||
//IndexLink is removed in react-router, but continues there in react-router-bootstrap for backwards compatibility.
|
||||
//IndexLink is removed in react-router, but continues there in react-router-bootstrap for backwards compatibility.
|
||||
//Better use <LinkContainer exact/>
|
||||
type IndexLinkContainer = ComponentClass<LinkProps>;
|
||||
type IndexLinkContainer = ComponentClass<NavLinkProps>;
|
||||
declare const IndexLinkContainer: IndexLinkContainer;
|
||||
|
||||
export default IndexLinkContainer;
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { ComponentClass } from "react";
|
||||
import { LinkProps } from "react-router-dom";
|
||||
import { NavLinkProps } from "react-router-dom";
|
||||
|
||||
type LinkContainer = ComponentClass<LinkProps>;
|
||||
type LinkContainer = ComponentClass<NavLinkProps>;
|
||||
declare const LinkContainer: LinkContainer;
|
||||
|
||||
export default LinkContainer;
|
||||
|
||||
@ -15,6 +15,7 @@ export class ReactRouterBootstrapTest extends Component<any, any> {
|
||||
|
||||
<div style={style}>
|
||||
<LinkContainer to="/page"><Button>Link</Button></LinkContainer>
|
||||
<LinkContainer to="/page" exact strict><Button>Link</Button></LinkContainer>
|
||||
<IndexLinkContainer to="/index"><Button>Link</Button></IndexLinkContainer>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user