English 中文(简体)
如何在反应/火力基中添加一个最新特征?
原标题:How to add a update profile pic feature in react/firebase?

Im利用反应堆和消防基地,进行聊天/小型社会媒体评估。 我致力于增加一个特点,使用户能够更新其名称和形象。 使用消防基地“更新材料”的Im对更新所有材料置之不理,因此,我用用户名称成功更新,但当我试图更新用户概况时,情况就没有发生。 我甚至没有发现与这一问题有关的任何错误。 我试图更新网页,检查消防基地,以了解任何变化,没有发生任何变化。 我尝试了黄色伐木,看看我的“显赫”使用国是否正在存储图像,而现在,我可以看到光彩中的形象细节和一切,但形象与用户名称一样变化。 谁能帮助我这样做?

这就是“显要”用途

  const [profilePic, setProfilePic] = useState(null);

这是一种功能,一旦用户点击“上载图像”纽扣。

  const updateProfilePic = async () =>{
    await updateProfile(auth.currentUser, {
      photoURL: profilePic
    }).then(() =>{
  
    }).catch((err) => {
      console.log(err)
    })
  }

这是意大利统计局。 “PulseLoader”只是从“反应-spinner”下载的反应堆载荷估算。

    <img className= change-img  src={firebaseUserInfo?.photoURL || <PulseLoader color={loaderColor}/>} />
    <label className= change-img-btn  onClick={updateProfilePic} for= input-file >Upload image</label>
    <input type= file  name="myImage" onChange={(e) =>{ console.log(e.target.files[0]); setProfilePic(e.target.files[0])}} id= input-file  />

here is a link to my full code. https://github.com/rsteward117/Chat-App/blob/main/src/componets/customizeProfile.js

问题回答

暂无回答




相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签