📜  反应原生星级组件 - Javascript代码示例

📅  最后修改于: 2022-03-11 15:01:48.637000             🧑  作者: Mango

代码示例1
import React, { useState } from 'react';
import { StyleSheet, Text, View } from 'react-native';
import RatingModal from 'react-native-rating-modal-box';

const App = () => {

    const [isOpenRating, setOpenRating] = useState(true);

    return (
    
      setOpenRating(false)}
        visible={isOpenRating}
        ratingConfirm={selectedRating => {
          console.log('Selected rating', selectedRating);
        }}
      />
    
  );
};

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: "center",
  },
  text: {
    fontSize: 16
  },
  wrapperCustom: {
    borderRadius: 8,
    padding: 6
  },
  logBox: {
    padding: 20,
    margin: 10,
    borderWidth: StyleSheet.hairlineWidth,
    borderColor: '#f0f0f0',
    backgroundColor: '#f9f9f9'
  }
});

export default App;