Comments (17)
Same issue.
from react-native-really-awesome-button.
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.
from react-native-really-awesome-button.
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.
@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.
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.
Can you provide a demo on Snack or a repo/gist? @eeshankeni
from react-native-really-awesome-button.
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 :
from react-native-really-awesome-button.
@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.
@awreese Thx i effectively followed your advises on SO 👍. The PR is done.
from react-native-really-awesome-button.
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.
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.
@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.
@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.
@ansh damn this package seems more trouble than its worth. Which is unfortunate cause its really rather good
from react-native-really-awesome-button.
is the dev dead?
from react-native-really-awesome-button.
This has been fixed in #108
from react-native-really-awesome-button.
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)
- Crashes on Android HOT 1
- More detailed styling options for creating button groups HOT 1
- buttons are pressed on scroll HOT 4
- Progress Loading Time
- The expo demo is outdated and doesn't work HOT 1
- fontFamily or textFontFamily? HOT 1
- "onPress" event only fired when I hold the button and not when touched HOT 13
- Expo needs update please HOT 1
- add support for hitSlop HOT 1
- Buttons unresponsive in Expo SDK 39 HOT 1
- Hair trigger when overlaying other button
- Button fires on swiping HOT 4
- Web platform not support do to use of depreciated ViewPropTypes HOT 1
- Problem with the colors? HOT 2
- A document problem HOT 1
- Transparent picture button HOT 1
- [ Feature ] add sound to the button
- is there a Input component with the same animations/styles/borderBottom 3d effect ?
- [Question] expose onPressOut method HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-really-awesome-button.