Coder Social home page Coder Social logo

Comments (17)

MonchiLin avatar MonchiLin commented on May 18, 2024 2

Same issue.

from react-native-really-awesome-button.

ansh avatar ansh commented on May 18, 2024

I have reached a solution via the help of StackOverflow: https://stackoverflow.com/questions/74297972/react-native-really-awesome-button-onpress-does-not-update-function-when-state-c

However, it is clear that this bug needs to be addressed in the repository.

@rcaferati

from react-native-really-awesome-button.

eeshankeni avatar eeshankeni commented on May 18, 2024

Can confirm this bug exists and needs to be fixed. It seems to not be present in the release version

from react-native-really-awesome-button.

ansh avatar ansh commented on May 18, 2024

@eeshankeni It is present in the release version. Check out my demo: https://snack.expo.dev/@anshnanda/awesomebutton-not-working

from react-native-really-awesome-button.

eeshankeni avatar eeshankeni commented on May 18, 2024

Weird, I tried to toggle the button's colour between two options using a state. It worked fine in the release but not in the latest version.

from react-native-really-awesome-button.

ansh avatar ansh commented on May 18, 2024

Can you provide a demo on Snack or a repo/gist? @eeshankeni

from react-native-really-awesome-button.

septpointdeux avatar septpointdeux commented on May 18, 2024

I confirm that the bug is present and it is quite embarassing since we can not use the base functionnality of a button ... "OnPress" playing with some states, which is quite a "basic" for a button

I have fixed using :

image

from react-native-really-awesome-button.

awreese avatar awreese commented on May 18, 2024

@septpointdeux This is effectively the solution I hinted at in my SO answer. Did you apply the fix in a local clone of the repo or are you planning to issue a pull request with the fix applied?

from react-native-really-awesome-button.

septpointdeux avatar septpointdeux commented on May 18, 2024

@awreese Thx i effectively followed your advises on SO 👍. The PR is done.

from react-native-really-awesome-button.

ansh avatar ansh commented on May 18, 2024

It has been almost a month, with a perfectly good PR created, and the maintainer of this package has not even responded. I have emailed him and he has seen the email many times and yet is probably too busy to maintain this.

So, I have forked the package, cleaned up the code, updated the dependencies, and published it under react-native-raised-button on NPM.

Please find it here https://www.npmjs.com/package/react-native-raised-button?activeTab=readme
and here https://github.com/ansh/react-native-raised-button

Looking forward to your contributions @septpointdeux and @awreese

from react-native-really-awesome-button.

eeshankeni avatar eeshankeni commented on May 18, 2024

Hey @ansh
Thanks for your fork, I've noticed that it too has a the same onPress bug as before and the color of the button does not change with every onPress. Would have made an issue on your repo directly but there seems to be no option.

Do check out my expo snack https://snack.expo.dev/@esean_keni/8465d3
Notice how the button changes colour only after multiple attempts. When it should instead be changing with every press.
Thank you!

from react-native-really-awesome-button.

ansh avatar ansh commented on May 18, 2024

@eeshankeni The example snack I initially gave that did not work with this package works now: https://snack.expo.dev/@anshnanda/awesomebutton-not-working so my fork solved my issue.

Not sure why your example doesn't work. Let me take a look.

from react-native-really-awesome-button.

ansh avatar ansh commented on May 18, 2024

@eeshankeni I have debugged your Snack and it seems like there is another bug in the original react-native-really-awesome-button package! This is actually absurd. I regret using this package now.

But in any case, the simplest fix is not pressing the button back-to-back. If you wait 1-2 seconds between pressing the button, the color changes every time. However, if you press the button in rapid succession, the color doesn't change and it doesn't register the new state. Not sure why this happening (maybe @awreese and @septpointdeux can take another look).

from react-native-really-awesome-button.

eeshankeni avatar eeshankeni commented on May 18, 2024

@ansh damn this package seems more trouble than its worth. Which is unfortunate cause its really rather good

from react-native-really-awesome-button.

Darren120 avatar Darren120 commented on May 18, 2024

is the dev dead?

from react-native-really-awesome-button.

ansh avatar ansh commented on May 18, 2024

This has been fixed in #108

from react-native-really-awesome-button.

ansh avatar ansh commented on May 18, 2024

However, since the original dev is not active, I made a fork that works better and will be maintained:
https://github.com/ansh/react-native-raised-button

All done in accordance with the MIT license

from react-native-really-awesome-button.

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.