reactjs - How do you do an Infinite scroll with React Native? -


i have scrollable list called datalist mapped according code. there call in index.js update list display more items in datalist. how modify scroll view implement infinite scroll call function when user scrolls point on datalist?

const mapstatetopropsdatalist = (state) => {   return {     datalistitems: state.resource.datalistitems   } }  const mapdispatchtopropsdatalist = (dispatch) => {   return {     read: ()=>{ resourceread(); }   } }  let datalist = ({datalistitems}) => {   var _scrollview: scrollview;   return (     <view style={styles.datalistbox}>       <view style={styles.datalistwrapper}>         <datalisttoolbar/>           <view style={styles.datalistcontentbox}>             <view style={styles.datalistcontentwrapper}>               <scrollview ref={(scrollview) => { _scrollview = scrollview; }}                 scrolleventthrottle={200}>                 <list>                   {datalistitems.map((items,index)=>(                     <div>                       <listitem>                         <div classname="listitembox">                           <div classname="listitemwrapper">                             <div classname="listitemimagebox">                               <img src={items.image}/>                             </div>                             <div classname="listitemtextbox">                               <div classname="listitemtextwrapper">                                 <div classname="listitemtexttitlebox">                                   <div classname="listitemtexttitlewrapper">                                     <span>{items.id}</span>                                   </div>                                 </div>                                 <div classname="listitemtextdescriptionbox">                                   <div classname="listitemtextdescriptionwrapper">                                     <p>{items.name}</p>                                   </div>                                 </div>                               </div>                             </div>                           </div>                         </div>                       </listitem>                     <divider/>                   </div>                   ))}                 </list>               </scrollview>             </view>           </view>       </view>     </view>   ) } // modify code datalist  datalist = connect(   mapstatetopropsdatalist,   mapdispatchtopropsdatalist )(datalist) 


Comments