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

Dependency issue #81

Open
vishnu-vk opened this issue Nov 30, 2022 · 1 comment
Open

Dependency issue #81

vishnu-vk opened this issue Nov 30, 2022 · 1 comment

Comments

@vishnu-vk
Copy link

const Register = () => {


  const {data} = useAuthUser(["user"], auth)

  const ref = doc(usersDb, data.uid)
  const addOtherFields = useFirestoreDocumentMutation(ref)
  
  const newUser = useAuthCreateUserWithEmailAndPassword(auth, {
    onSuccess(){
      addOtherFields.mutate({name: "jhon Smith", age:20})
    }
  })
  

  const submit = () => {
    newUser.mutate({ email: "[email protected]", password: "123456" });
  };


  return (
    <div>
      <button onClick={submit}>register</button>
    </div>
  );
};

export default Register;

how can I use the uid of the user in the doc reference path.
I am trying to add additional data about the user in a users collection.

@fhuel
Copy link

fhuel commented Feb 17, 2023

You can use the enabled option as mentioned here : #18

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

2 participants