Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I cannot update Badge action by state #2307

Open
2 of 6 tasks
llr101 opened this issue Jul 15, 2024 · 1 comment
Open
2 of 6 tasks

I cannot update Badge action by state #2307

llr101 opened this issue Jul 15, 2024 · 1 comment
Labels
bug Something isn't working v1 gluestack-ui v1

Comments

@llr101
Copy link

llr101 commented Jul 15, 2024

Description

I cannot update Badge action by state

CodeSandbox/Snack link

below

Steps to reproduce

const [isMuted, setIsMuted] = useState(false);

useEffect(() => {
  setTimeout(() => setMuted(prev => !prev), 1000);
}, [])

return (
  <Badge action={isMuted ? 'muted' : 'info'}>
    <BadgeText>test badge</Badge>
  </Badge>
)

gluestack-ui Version

1.1.39

Platform

  • Expo
  • React Native CLI
  • Next
  • Web
  • Android
  • iOS

Other Platform

No response

Additional Information

No response

@llr101 llr101 added the bug Something isn't working label Jul 15, 2024
@Viraj-10 Viraj-10 added the v1 gluestack-ui v1 label Jul 19, 2024
@jkearney126
Copy link

Had the same issue trying to use state for updates. A workaround is to set a key prop that changes with state - forces a new component render.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working v1 gluestack-ui v1
Projects
Status: Backlog
Development

No branches or pull requests

3 participants