2017-12-18 2 views
0

getItemLayoutプロパティをSectionListに定義するために、jsoendermann/rn-section-list-get-item-layout npmパッケージを使用しています。 scrollToLocation()を動作させるには、getItemLayoutプロパティを定義する必要があります。外部ライブラリに送信されたParamsは宣言されていますが使用されていません

ドキュメントは、それは次のように使用すべきであると述べている:

import sectionListGetItemLayout from 'react-native-section-list-get-item-layout' 

// cut.. 

    this.getItemLayout = sectionListGetItemLayout({ 
     // The height of the row with rowData at the given sectionIndex and rowIndex 
     getItemHeight: (rowData, sectionIndex, rowIndex) => 
                sectionIndex === 0 ? 100 : 50, 
    } 

    render() { 
    return (
     <SectionList 
     {...otherStuff} 
     getItemLayout={this.getItemLayout} 
     /> 
    ) 
    } 
} 

活字体(2.5.3)コンパイラは、この行文句:

getItemHeight:(rowData、sectionIndex、rowIndexに)= > sectionIndex === 0? 100:50、

error TS6133: 'rowData' is declared but never used. error TS6133: 'rowIndex' is declared but never used.

私はrowDatarowIndexの両方を推測するには、NPMパッケージに内部的に使用されているが、どのように私はTSコンパイラにそれを教えていますか?

答えて

関連する問題