I'm trying to make a scroll to the heading1.
But when I'm trying to save Y position of the element it's constantly rerendering.
and in the console I see
0
245
0
245
0
245
etc...
I also tried to make an if-else statement to prevent infinity rerenders but then I always have a Y = 0 all the time.
I'm trying to make a scroll to the heading1. But when I'm trying to save Y position of the element it's constantly rerendering. and in the console I see 0 245 0 245 0 245 etc...
I also tried to make an if-else statement to prevent infinity rerenders but then I always have a Y = 0 all the time.
`const myRules = { heading1: (node, children) => ( <View key={node.key} style={mdStyles.indexHeaderWrapper} onLayout={(event) => { const { layout } = event.nativeEvent; setY(layout.y) }}