Extending union types by interface

export declare type RouteProps = PathRouterProps | LayoutRouterProps |IndexRouteProps;
interface IOwnProps extends RouteProps {
hasAnyAuthorities?: string[];
}
export declare type RouteProps = PathRouterProps | LayoutRouterProps |IndexRouteProps;
interface IOwnProps extends RouteProps {
hasAnyAuthorities?: string[];
}
I am getting An interface can only extend an object type or intersection of object types with statically known members
2 Replies
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Sebastian
Sebastian2y ago
Types cannot be extended with the extends keyword, you could try:
export declare type RouteProps = PathRouterProps | LayoutRouterProps | IndexRouteProps;
export type IOwnProps = RouteProps & { hasAnyAuthorities?: string[]; }
export declare type RouteProps = PathRouterProps | LayoutRouterProps | IndexRouteProps;
export type IOwnProps = RouteProps & { hasAnyAuthorities?: string[]; }
Want results from more Discord servers?
Add your server