Skip to content

Dependency issue #81

Open
Open
@vishnu-vk

Description

@vishnu-vk
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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    react-query-firebaseIssue is specific to React Query Firebase branch

    Type

    No type

    Projects

    Status

    Opened

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions