admin管理员组文章数量:1358086
I am a beginner in reactjs when I tried to run a program it showed the following error
Uncaught TypeError: Cannot destructure property 'recipes' of 'props' as it is undefined.
at RecipeList (bundle.js:532:5)
at renderWithHooks (bundle.js:22834:22)
at mountIndeterminateComponent (bundle.js:25596:17)
at beginWork (bundle.js:26795:20)
at HTMLUnknownElement.callCallback (bundle.js:11784:18)
at Object.invokeGuardedCallbackDev (bundle.js:11833:20)
at invokeGuardedCallback (bundle.js:11893:35)
at beginWork$1 (bundle.js:31635:11)
at performUnitOfWork (bundle.js:30471:16)
at workLoopSync (bundle.js:30408:9)
I am a beginner in reactjs when I tried to run a program it showed the following error
Uncaught TypeError: Cannot destructure property 'recipes' of 'props' as it is undefined.
at RecipeList (bundle.js:532:5)
at renderWithHooks (bundle.js:22834:22)
at mountIndeterminateComponent (bundle.js:25596:17)
at beginWork (bundle.js:26795:20)
at HTMLUnknownElement.callCallback (bundle.js:11784:18)
at Object.invokeGuardedCallbackDev (bundle.js:11833:20)
at invokeGuardedCallback (bundle.js:11893:35)
at beginWork$1 (bundle.js:31635:11)
at performUnitOfWork (bundle.js:30471:16)
at workLoopSync (bundle.js:30408:9)
Share
Improve this question
edited Apr 2, 2022 at 8:51
Andy
63.6k13 gold badges71 silver badges98 bronze badges
asked Apr 2, 2022 at 8:43
MilanMilan
1831 gold badge3 silver badges15 bronze badges
2
- Please add the code you've attempted to your question as a minimal reproducible example. Here's some documentation on how to create a React snippet. – Andy Commented Apr 2, 2022 at 8:44
- when i tried to add my code it's showing ``` It looks like your post is mostly code; please add some more details``` – Milan Commented Apr 2, 2022 at 8:48
2 Answers
Reset to default 3One of your assignments is not properly transferred to a ponent, that is why it is "Undefined".
Upload the parts of the code related to this props code or alternative try it yourself with console.log(props): check what is defined and what is not. Then connect the two.
Maybe you used const { recipes } = props
in your code, however, props are undefined, so you get the error destructure property
.
Can you put your code there? And check that the props are not undefined. Check parent ponent send useful data to child ponent.
本文标签:
版权声明:本文标题:javascript - Uncaught TypeError: Cannot destructure property 'recipes' of 'props' as it is undef 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1743895352a2557682.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论