在我的打字稿/ reactjs應用程序我想在這樣的屬性稱爲測試通過,這是index.tsx的一部分:如何解決打字稿錯誤TS2339:屬性'XXX'不存在類型'IntrinsicAttributes&...?
ReactDOM.render(
<Provider store={getStore()}>
<BrowserRouter>
<App test={1} />
</BrowserRouter>
</Provider>,
document.getElementById('content')
);
在我app.tsx我:
export class App extends React.Component<any,{}>{
constructor(props){
super(props);
}
render(){
..
}
}
當我運行應用程序,我得到這個錯誤:
ERROR in ./src/index.tsx
(24,12): error TS2339: Property 'test' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<Component<{}, ComponentState>> & Readonly<{ childr...'.
我怎樣才能確保這個錯誤得到解決或者我怎麼能在財產傳給我的應用程序組件?