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