【发布时间】:2022-07-28 03:06:53
【问题描述】:
我正在尝试将generateQuestion 函数放在哪里,如果我把它放在App.js
如何将 props 从 App.js 传递到 Quiz.js
如果您有更好的路由实现和generateQuestion 功能,请随时留下您的建议
【问题讨论】:
-
你说你想从 App 传递 props 给 Question,但没有在那里渲染
-
@Dominic 对不起,我的意思是
Quiz.js -
为什么不使用 redux-saga 或 react-toolkit ?纯反应不是一个好的解决方案。
标签: reactjs react-hooks react-router react-router-dom