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

useSignup() method returning singUp as undefined in react-native #2

Closed
rekha110254 opened this issue Aug 9, 2022 · 3 comments
Closed

Comments

@rekha110254
Copy link

const {signUp} = useSingUp()

signup.create({}}

signup is always undefined.

@asaschachar
Copy link

asaschachar commented Sep 13, 2022

I'm also seeing a similar issue where signUp is undefined when trying to follow the examples in this repo.

Below is a minimal example that will log the value of undefined for signUp

// In App.js
import { useEffect, useState } from "react";
import { Text, View } from "react-native";
import { ClerkProvider, useAuth } from "@clerk/clerk-expo";
import * as SecureStore from "expo-secure-store";

function Main(props) {
  const { signIn, isLoaded } = useAuth();
  const [testVariable, setTestVariable] = useState(true);

  useEffect(() => {
    const interval = setInterval(() => {
      console.log("=== Test ===");
      console.log("isLoaded: ", isLoaded);
      console.log("signIn: ", signIn);
      console.log(
        "testVariable (toggles between true and false): ",
        testVariable
      );
      setTestVariable(!testVariable);
    }, 5000);

    return () => {
      clearInterval(interval);
    };
  }, [signIn, testVariable, isLoaded]);

  return (
    <View
      style={{
        display: "flex",
        justifyContent: "center",
        alignItems: "center",
        width: "100%",
        height: "100%",
      }}
    >
      <Text>Hello World!</Text>
    </View>
  );
}

const tokenCache = {
  getToken(key: string) {
    return SecureStore.getItemAsync(key);
  },
  saveToken(key: string, value: string) {
    return SecureStore.setItemAsync(key, value);
  },
};

export default function App() {
  return (
    <ClerkProvider
      tokenCache={tokenCache}
      frontendApi="clerk.resolved.oarfish-84.lcl.dev"
    >
      <Main />
    </ClerkProvider>
  );
}

With the following versions:

"@clerk/clerk-expo": "^0.9.52"
"expo": "~46.0.9"
"expo-secure-store": "~11.3.0"
"react": "18.0.0"
"react-native": "0.69.5"

@cmaycumber
Copy link

I'm also seeing this and am also on "expo": "~46.0.9". Maybe it's an issue with React 18?

@perkinsjr
Copy link
Contributor

This should be resolved with latest versions please re-open if not.

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

No branches or pull requests

4 participants