We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fb62167 commit aea606bCopy full SHA for aea606b
src/index.tsx
@@ -98,10 +98,14 @@ export function useNetlifyIdentity(
98
url: string,
99
onAuthChange: authChangeParam = () => {}
100
): ReactNetlifyIdentityAPI {
101
- const goTrueInstance = new GoTrue({
102
- APIUrl: `${url}/.netlify/identity`,
103
- setCookie: true,
104
- });
+ const goTrueInstance = React.useMemo(
+ () =>
+ new GoTrue({
+ APIUrl: `${url}/.netlify/identity`,
105
+ setCookie: true,
106
+ }),
107
+ [url]
108
+ );
109
110
const [user, setUser] = React.useState<User | undefined>(
111
goTrueInstance.currentUser() || undefined
0 commit comments