Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

react-native SectionList scrollTo

Tags:

react-native

I'm new to react-native and tried using SectionList. Everything's working fine, so far. However, I can't seem to use the scrollToLocation function as defined in facebook's documentation. Anyone tried using it or anything similar? Basically, I want to scroll to a specific, section and item.

return Promise.all([
  props.orderActions.set(orders, true),
  props.orderActions.set(orders, false),
]).then(() => {
  return this._ordersList.scrollToLocation({
    animated: false,
    sectionIndex: 0,
    itemIndex: historyItems.length - 1
  })
})

_ordersList is a reference to the SectionList component.

Thanks!

like image 436
justelouise Avatar asked Jul 16 '26 15:07

justelouise


1 Answers

Upgrading to 0.45 did it. Had performance issues but managed to fix it by using PureComponent

like image 110
justelouise Avatar answered Jul 18 '26 11:07

justelouise



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!