Skip to content

Commit c8e9a19

Browse files
sisisinchristopherthielen
authored andcommitted
refactor(component): add interface to UISref Component
1 parent 2fe30e0 commit c8e9a19

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/components/UISref.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,20 @@ import { UISrefActiveConsumer } from './UISrefActive';
1717
let classNames = _classNames;
1818

1919
export interface UISrefProps {
20-
router: UIRouterReact;
21-
addStateInfoToParentActive: Function;
22-
parentUIView: UIViewAddress;
2320
children?: any;
2421
to: string;
2522
params?: { [key: string]: any };
2623
options?: TransitionOptions;
2724
className?: string;
2825
}
2926

30-
class Sref extends Component<UISrefProps, any> {
27+
interface SrefProps extends UISrefProps {
28+
router: UIRouterReact;
29+
addStateInfoToParentActive: Function;
30+
parentUIView: UIViewAddress;
31+
}
32+
33+
class Sref extends Component<SrefProps, any> {
3134
// deregister function for parent UISrefActive
3235
deregister: Function;
3336
static propTypes = {
@@ -90,7 +93,7 @@ class Sref extends Component<UISrefProps, any> {
9093
}
9194
}
9295

93-
export const UISref = props => (
96+
export const UISref = (props: UISrefProps) => (
9497
<UIRouterConsumer>
9598
{router => (
9699
<UIViewConsumer>

0 commit comments

Comments
 (0)