Giter Site home page Giter Site logo

kolking / react-native-rating Goto Github PK

View Code? Open in Web Editor NEW
51.0 51.0 2.0 9.39 MB

โญ๏ธ โค๏ธ ๐Ÿ˜€ An interactive rating component for React Native that can display ratings using stars, hearts, emojis, or custom symbols.

License: MIT License

JavaScript 5.07% TypeScript 25.67% Ruby 2.78% Starlark 1.32% Java 33.39% Makefile 3.34% C++ 15.25% Objective-C 5.22% Objective-C++ 7.98%
android emoji-rating evaluate feedback ios rate rating rating-stars react-native stars-rating user-rating

react-native-rating's People

Contributors

dependabot[bot] avatar kolking avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

react-native-rating's Issues

PanResponder uses location of current component

Hi! Me again ๐Ÿ˜…
Given how the PanResponder works, the position of the touch is calculated against the current component you're touching.
Because of this, when you drag a rating outside of its boundaries, the ratings get messed up:

video_2024-01-05_20-40-49.mp4

This behaviour is explained in this issue. There is a PR from the official react native slider that addresses this: #221 sliding on track edge bugs
Do you think something similar could implemented here, so that the sliding works regardless of the position of the rating?
Thanks a lot, and again, if I can help please let me know!

Works great! Some requests...

Great package, thanks for this. Just a couple observations upon first wiring this up.

  1. When right aligning the rating component, the pan gesture handler seems to only register on the left side screen still. Not sure how to best explain this other than showing some example React code. So for the code below, I have to move my thumb to the left side of the screen for the onMove to register. This was on my iOS device.
<View className="flex flex-row justify-between items-center">
  <View>
    <Text className="text-lg">Rating</Text>
  </View>
  <View>
     <Rating
        onChange={onChange}
        onMove={onChange}
        rating={value}
      />
  </View>
</View>
  1. Given the library supports displaying partial stars, it would be awesome if the pan control would let you select partial stars. For example, I would love to support half star increments via the pan gestures!

Huge Performance issues

I want to render some ratings in a FlatList. However, when I navigate to the screen where the list is supposed to be rendered, it takes a considerable amount of time to open. But actually is good Package. Can u check that.

can we indicate selected rating?

Purpose
Needs to indicate when user selects a rating. E.g user selected 3 rating but haven't found any way out to show this to user.

Can we use decimals?

Hi!

It's really a nice component that you created!

I'm trying to use it to rate things with 0.5 steps but I seem to only receive integer values (from onChange or onMove).
Is the decimal only possible with the default value or I missed something?

Thanks for you help!

WARN: Excessive number of pending callbacks: 501

Hello! First of all, thanks for this library, it's awesome! ๐Ÿš€
When using it in a react native app with Expo, I get the following warning on boot. The library works fine, but this warning seems to suggest some leak. Please let me know if I can help in any way to fix this!

WARN  Please report: Excessive number of pending callbacks: 501. 
Some pending callbacks that might have leaked by never being called from native code: 
{
 "186": { "module": "NativeAnimatedModule", "method": "startAnimatingNode" },
 "336": { "module": "NativeAnimatedModule", "method": "startAnimatingNode" },
 "352": { "module": "NativeAnimatedModule", "method": "startAnimatingNode" },
 "3810": { "module": "NativeAnimatedModule", "method": "startAnimatingNode" },
 "3825": { "module": "NativeAnimatedModule", "method": "startAnimatingNode" },
... 
RatingSymbol@http://192.168.1.66:19000/node_modules/expo/AppEntry.bundle?platform=android&dev=true&hot=false:191284:20

(it goes on for quite a while). Full log:
rating-warning.log

This is how I use it in my code:

export const RistoRating = ({
  rating,
  onChange,
  readonly = true
}: RistoRatingProps) => {
  return (
    <View>
      <Rating
        size={25}
        rating={rating / 2}
        onChange={onChange}
        disabled={readonly}
      />
    </View>
  )
}

Thanks in advance for your help!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.