0
私のMessageDialog内でSectionListへの紹介をthis.SectionList
に保存します。 31行目でSectionListを許可するようにインターフェースを定義しようとしましたが、それは効果がありません。私は何をすべきか? MessageDialog.tsx(132,38): error TS2339: Property 'SectionList' does not exist on type 'SkademeldingDialog'
反応クラスの関数のTypeScriptインターフェイスを定義する方法は?
29 interface IComponentProps {
30 navigation: NavigationScreenProp<any, any>;
31 SectionList: any; // I tried to add SectionList here, but that did not work.
32 }
33
34 interface IDispatchToProps {
35 requestHendelsesvelger: RequestHendelsesvelgerInterface;
36 requestProsessguide: RequestProsessguideInterface;
37 }
38
39 type Props = IComponentProps & IDispatchToProps;
121 class MessageDialog extends React.Component<Props> {
128 public render() {
129
130 return (
131 <SectionList
132 ref={(sectionlist) => { this.SectionList = sectionlist; }}
137 >
138 </SectionList>
これはほとんど動作しました。 :-) 'MessageDialog.tsx(127,24):エラーTS2314:汎用型 'SectionList'には1つの型引数が必要です。私が 'private sectionList:any'を実行すると、警告は表示されません。どのように私は正しいタイプを得ることができる任意のアイデア? – martins
私はDefinitelyTypedを追加しようとします。それはSectionListのためにタイプしているようです。 – martins
あなたは正しいタイプのargsを追加しなければならないでしょう、SectionListを見ることなく、私は彼らが何であろうと言います。例: 'private sectionList:SectionList' –
wgcrouch