我的状态更新在 React JS 中不起作用
我的代码没有按预期工作。以下是相同内容的详细信息: NewUserContext 的值为 newUserData,NewUserDispatchContext 的值为 setNewUserData。
时,setValue 函数就会被执行,并且新形成的对象会得到 console.log,因为我在 BasicInformation.jsx 中标记的行但在 Profile.jsx 中 useEffect 不起作用您可以看到附加的图像
Github 存储库 - https://github.com/Team-Antern/Antern-Website BasicInformation.jsx - https://github.com/Team-Antern/Antern-Website/blob/master/src/Components/DashboardMain/Profile/BasicInformation/BasicInformation.jsx Profile.jsx - https: //github.com/Team-Antern/Antern-Website/blob/master/src/Components/DashboardMain/Profile/Profile.jsx
我已经附加了代码,所以你可以查看它。
My code is not working expected. Here are the details for the same:
NewUserContext has a value of newUserData and NewUserDispatchContext has a value of setNewUserData.
Now when I type something in input box then the setValue function gets executed and the new formed object gets console.log due to the line I marked in BasicInformation.jsx but in Profile.jsx useEffect is not working you can see the attached images
Github repo - https://github.com/Team-Antern/Antern-Website
BasicInformation.jsx - https://github.com/Team-Antern/Antern-Website/blob/master/src/Components/DashboardMain/Profile/BasicInformation/BasicInformation.jsx
Profile.jsx - https://github.com/Team-Antern/Antern-Website/blob/master/src/Components/DashboardMain/Profile/Profile.jsx
I have attached the code so that you can look over it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论