Liron Yahdav
Liron Yahdav

Reputation: 10732

React Native ListView renderSeparator showing separator below last row

I think I'm missing something obvious but I can't get a React Native ListView to render separators only between each row. It renders the separator after all rows even though the renderSeparator documentation says it should not render below the last row.

Below is a screenshot of two different list views I created with the same issue. You can see the code here: https://sketch.expo.io/rkQZg8hsx, though be careful if you use the Appetize simulator on Sketch because it scales the simulator so may not see the separator. It's better to test on a real device.

enter image description here

Upvotes: 1

Views: 1957

Answers (1)

Pat Needham
Pat Needham

Reputation: 5938

If provided, a renderable component to be rendered as the separator below each row but not the last row if there is a section header below. Take a sectionID and rowID of the row above and whether its adjacent row is highlighted.

You're not including section headers in the example code, which must explain why the separator is showing after the last row.

Upvotes: 1

Related Questions