0
我想向RouteProps接口添加一个name属性。没有它,我得到:TypeScript 2.0和合并在Route.d.ts中声明的react-router接口
错误TS2339:房产 '名' 上不存在型 'IntrinsicAttributes &> IntrinsicClassAttributes> & RouteProp ......'
如果我添加name?: string;
到外部路由。 d.ts文件错误消失。
我试图合并模块的一些建议的方式没有成功。
外部Route.d.ts声明开始了这样的:
declare const self: self.Route;
type self = self.Route;
export default self;
declare namespace self {
interface RouteProps extends React.Props<Route> {...
我使用打字稿2.
中看到我的问题请在你提供的链接中添加一些必要的部分/不支持链接回答。 :) – gofr1