Coder Social home page Coder Social logo

Comments (7)

knnemade99 avatar knnemade99 commented on August 21, 2024 1

@PAK90 and @ashishd751
You can use property edit={undefined} for editing the react stars.
And property edit={false} or edit={true} for not editing the react stars.

So that you can change the edit functionality dynamically using edit property.

from react-stars.

olegberman avatar olegberman commented on August 21, 2024 1

Thank you - I will take a look soon.

from react-stars.

ashishd751 avatar ashishd751 commented on August 21, 2024

Yes , @PAK90 , i am facing a similar issue.
I want to dynamically set the edit flag, bt since the flag gets overridden , i am unable to do so.
Has anyone found a work-around for that ?
Or, has this bug been fixed ?

from react-stars.

raulfdm avatar raulfdm commented on August 21, 2024

@knnemade99 works as you said, but is it a bug, isn't it?

from react-stars.

ashishd751 avatar ashishd751 commented on August 21, 2024

from react-stars.

vaibhavvv9 avatar vaibhavvv9 commented on August 21, 2024

<ReactStars size={40}
count={4}
value={rating}
edit={isEdit ? undefined : false}
onChange={handleRating}
/>
@knnemade99 I am trying to change edit conditionally using this way but it is not working. I have tried every permutation combination with undefined, true & false but it is still not working. Can you please help me ?

from react-stars.

knnemade99 avatar knnemade99 commented on August 21, 2024

@vaibhavvv9
Try something like

const isEditProp = isEdit ? undefiend : true;

Then use above variable in following code

<ReactStars size={40}

count={4}
value={rating}
edit={isEditProp}
onChange={handleRating}
/>

In this way if isEdit is true, it will be editable and if isEdit is false, it wont be editable.

from react-stars.

Related Issues (20)

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.