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

Conditional rendering breaks #27

Closed
Sveagruva opened this issue Aug 30, 2024 · 1 comment · Fixed by #28
Closed

Conditional rendering breaks #27

Sveagruva opened this issue Aug 30, 2024 · 1 comment · Fixed by #28

Comments

@Sveagruva
Copy link

Describe the bug
If you don't put LoginButton into it's own container and try to conditionally render, it will stay after the first render forever.

To Reproduce
Steps to reproduce the behavior:

  1. Create a conditional render and render LoginButton
  2. Change condition

Expected behavior
Not rendering LoginButton results in no button

  const [click, setClick] = useState(false);

return ( 
<>
<Button onClick={() => setClick((v) => !v)}>
  click
</Button>
{
  click ?
    <Button>
      Feed
    </Button> :
    <LoginButton
      botUsername={}
      authCallbackUrl={}
      buttonSize="large"
      cornerRadius={5}
      showAvatar={false}
    />
}
</>
)

Screenshot 2024-08-30 at 10 13 18 AM
@manzoorwanijk
Copy link
Owner

Thank you for reporting the issue. #28 should fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants