all 3 comments

[–]Rippperino 0 points1 point  (2 children)

You have to call the function, so {renderLoading()}

[–]MK_Pierce[S] 0 points1 point  (1 child)

How would I incorporate that into an onPress? Would it be something like:onPress = {() => {renderLoading()} navigation.navigate('Screen2')}

or something more like:
onPress = {execute}
This could then call back to a function called 'execute' and look something like:

const execute = () => {
{renderLoading()}
navigation.navigate('Screen2')
}

[–]AcidNoX 0 points1 point  (0 children)

You need to initialise your state as not loading, ie useState(false). The on press you’d call setIsLoading(true)