Created
September 5, 2020 16:06
-
-
Save akulsr0/e0ec21801fdd8c0334c4cac841c48a30 to your computer and use it in GitHub Desktop.
React Native UI App - Ratings
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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