Reputation: 14363
I am having this react-native-paper
button:
<Button
disabled={loading}
icon="refresh"
mode="contained"
onPress={this.refreshData.bind(this)}
>
Refresh
</Button>
How can I make the icon spin when loading=true
?
Upvotes: 1
Views: 3324
Reputation: 247
for the spinning icon do this.
declare one variable refreshing
any boolean value when data refresh value set to be true and icon spinning start.
<Button
loading={loading}
disabled={loading}
icon="refresh"
mode="contained"
onPress={this.refreshData.bind(this)}
>
Refresh
</Button>
react-native-paper button have props like.. loading it's simply spinning icon
here snack link
Upvotes: 6