# React Auth0 button sometimes doesn't work?

**URL:** <https://community.auth0.com/t/react-auth0-button-sometimes-doesnt-work/102746>\
**Category:** Get Help\
**Tags:** login-experience, new-universal-login-experience\
**Created:** [March 16, 2023, 9:26pm UTC](https://community.auth0.com/t/react-auth0-button-sometimes-doesnt-work/102746 "2023-03-16T21:26:20Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![raunakdaga](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/raunakdaga/32/45529_2.png) [@raunakdaga](https://community.auth0.com/u/raunakdaga)\
**Post date:** [March 16, 2023, 9:26pm UTC](https://community.auth0.com/t/react-auth0-button-sometimes-doesnt-work/102746/1 "2023-03-16T21:26:20Z")

</div>

Hey all,

I’m using the auth0 react package. Pretty simple log in flow. Standard stuff.

I have a super odd bug, which is sometimes triggered, and sometimes not. Users will try to click on a button that has the onClick={loginWithRedirect}, and nothing will happen. No console output, nothing to sentry, there is no error at all. The button simply doesn’t do anything. It’s difficult to recreate, as we don’t know what causes it, but it affects a decent amount (5-10% of our users). My suspicion is adblock or antivirus, but sometimes after disabling those, it still occurs.

Below is the code we use:

```auto
<AwesomeButton
					type='primary'
					style={{
						"--button-primary-color": "#7c55d6",
						"--button-primary-color-dark": "#6444ad",
						"--button-primary-color-light": "#fff",
						"--button-primary-color-hover": "#6444ad",
						"--button-primary-color-active": "#6444ad",
					}}
					onPress={() =>
						loginWithRedirect({
							screen_hint: "login",
							mode: "login",
						})
					}
				>
					Log in
				</AwesomeButton>

```

```auto
const root = ReactDOM.createRoot(document.getElementById("root"))
root.render(
	<BrowserRouter>
		<Auth0Provider
			domain={process.env.REACT_APP_AUTH0_DOMAIN}
			clientId={process.env.REACT_APP_AUTH0_CLIENT_ID}
			redirectUri={process.env.REACT_APP_REDIRECT_URI}
			audience={process.env.REACT_APP_AUDIENCE}
			scope='read:current_user'
			useRefreshTokens={true}
			cacheLocation='localstorage'
		>
			<App />
			<Toaster />
		</Auth0Provider>
	</BrowserRouter>
)

```

Anybody faced this problem using React login before?

Frontend service is Vercel, environment variables are definitely set.

Any help at all please?

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [March 17, 2023, 9:04am UTC](https://community.auth0.com/t/react-auth0-button-sometimes-doesnt-work/102746/2 "2023-03-17T09:04:53Z")

</div>

Hey there!

In order to handle that most effectively can I ask you to raise it as a GitHub issue in the React SDK GitHub repo so we can talk about it directly with the SDK maintainers? Once you have a link to it please share it here so we can ping them. Thank you!

> **[GitHub - auth0/auth0-react: Auth0 SDK for React Single Page Applications (SPA)](https://github.com/auth0/auth0-react)**
>
> Auth0 SDK for React Single Page Applications (SPA) - GitHub - auth0/auth0-react: Auth0 SDK for React Single Page Applications (SPA)

---

<div class="post-metadata">

**Author:** ![raunakdaga](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/raunakdaga/32/45529_2.png) [@raunakdaga](https://community.auth0.com/u/raunakdaga)\
**Post date:** [March 20, 2023, 11:37pm UTC](https://community.auth0.com/t/react-auth0-button-sometimes-doesnt-work/102746/3 "2023-03-20T23:37:21Z")

</div>

[Bug with loginWithRedirect · Issue #524 · auth0/auth0-react · GitHub](https://github.com/auth0/auth0-react/issues/524) @konrad.sopala

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [March 21, 2023, 10:26am UTC](https://community.auth0.com/t/react-auth0-button-sometimes-doesnt-work/102746/4 "2023-03-21T10:26:54Z")

</div>

Thanks a lot, I’ll ping the repo maintainers in a few minutes!

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [April 4, 2023, 10:27am UTC](https://community.auth0.com/t/react-auth0-button-sometimes-doesnt-work/102746/5 "2023-04-04T10:27:03Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
