【问题标题】:React - Component prop doesn't update while state updated (getter of the useState is assigned to the prop)React - 状态更新时组件道具不更新(useState 的 getter 已分配给道具)
【发布时间】:2023-01-28 02:24:02
【问题描述】:

与标题相同。我会给你我在 Github 上的代码。 当我单击按钮设置下一个对话框(视觉小说)时,它崩溃而不是更新值。

看看 App.js,您会看到它的作用。

The image doesn't show, it's voluntary

Github 回购:https://github.com/KinyaDev/VN-Fursave

我期待道具的更新,但它崩溃了。

【问题讨论】:

  • 请查看How to Ask页面。问题应该独立存在,相关代码、配置、错误等格式正确。

标签: javascript reactjs


【解决方案1】:

我以某种方式修复了它,但我必须点击两次,第一次点击时,它显示了一个奇怪的错误: |groupOptions: {}|namespace object:10 Uncaught (in promise) Error: Cannot find module './' at |groupOptions: {}|namespace object:10:1

【讨论】:

    猜你喜欢
    • 2020-11-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-01-16
    • 2021-12-14
    • 2020-06-19
    • 1970-01-01
    • 2020-10-23
    相关资源
    最近更新 更多