mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
32 lines
642 B
TypeScript
32 lines
642 B
TypeScript
import * as React from 'react';
|
|
import StarRating from 'react-native-star-rating';
|
|
|
|
interface State {
|
|
starCount: number;
|
|
}
|
|
|
|
class GeneralStarExample extends React.Component<{}, State> {
|
|
state = {
|
|
starCount: 3.5
|
|
};
|
|
|
|
onStarRatingPress = (rating: number) => {
|
|
this.setState({
|
|
starCount: rating
|
|
});
|
|
}
|
|
|
|
render() {
|
|
return (
|
|
<StarRating
|
|
disabled={false}
|
|
maxStars={5}
|
|
rating={this.state.starCount}
|
|
selectedStar={this.onStarRatingPress}
|
|
/>
|
|
);
|
|
}
|
|
}
|
|
|
|
export default GeneralStarExample;
|