Skip to content

Instantly share code, notes, and snippets.

@akulsr0
Created September 5, 2020 16:06
Show Gist options
  • Save akulsr0/e0ec21801fdd8c0334c4cac841c48a30 to your computer and use it in GitHub Desktop.
Save akulsr0/e0ec21801fdd8c0334c4cac841c48a30 to your computer and use it in GitHub Desktop.
React Native UI App - Ratings
import React from 'react';
import {
View,
} from 'react-native';
// npm i react-native-ratings
import { Rating } from 'react-native-ratings';
export default function App() {
return() {
<View>
<Rating
onFinishRating={(rating) => {
Alert.alert('Star Rating: ' + JSON.stringify(rating));
}}
style={{ paddingVertical: 10 }}
/>
<Rating
type='heart'
ratingCount={3}
imageSize={60}
onFinishRating={(rating) => {
Alert.alert('Heart Rating: ' + JSON.stringify(rating));
}}
/>
</View>
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment