简体   繁体   English

函数作为 React 子级无效。 如果您返回一个组件而不是从渲染中返回,则可能会发生这种情况。 Redux

[英]Functions are not valid as a React child. This may happen if you return a Component instead of from render. Redux

I am working with react-redux, and I use stateless components我正在使用 react-redux,并且我使用无状态组件

The error错误

This is my index.js这是我的 index.js

My app.js我的 app.js

the store is in another index.js file, inside a folder called redux该商店位于另一个 index.js 文件中,位于名为 redux 的文件夹中

I have tried NewHOC, but I can't get rid of the error我已经尝试过NewHOC,但我无法摆脱错误

I believe you've had a look at this question since you mentioned "NewHOC".自从您提到“NewHOC”以来,我相信您已经看过这个问题

With that in mind, ensure that in all your components you make use of a return statement if they are functional components or have a render method if they are class based components.考虑到这一点,请确保在所有组件中,如果它们是功能组件,则使用return语句;如果它们是基于 class 的组件,则确保它们具有渲染方法。

Based on your screenshots, it seems RouterDirectory is the likely culprit as the screenshots you did upload look fine but we can't see RouterDirectory.根据您的屏幕截图, RouterDirectory似乎是罪魁祸首,因为您上传的屏幕截图看起来不错,但我们看不到 RouterDirectory。

If you can provide the code for RouterDirectory we can help you further.如果您可以提供RouterDirectory的代码,我们可以进一步帮助您。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 函数作为 React 子级无效。 如果您返回 Component 而不是<component />从渲染。 在反应 v6 - Functions are not valid as a React child. This may happen if you return a Component instead of <Component /> from render. in react v6 React 显示“函数作为 React 子级无效。 如果您返回 Component 而不是<component />从渲染” - React is showing “Functions are not valid as a React child. This may happen if you return a Component instead of <Component /> from render” 函数作为 React 子级无效。 如果您返回 Component 而不是<component />从渲染 - Functions not valid as a React child. This may happen if you return a Component instead of <Component /> from render 函数作为 React 子项无效。 如果您返回一个组件而不是从渲染中返回,则可能会发生这种情况 - Functions are not valid as a React child. This may happen if you return a Component instead of from render 函数作为 React 子级无效。 如果您返回 Component 而不是<component />从渲染。 如何解决这个问题 - Functions are not valid as a React child. This may happen if you return a Component instead of <Component /> from render . how can fix that 错误函数作为 React 子级无效。 如果您返回 Component 而不是<Component />从渲染 - Error Functions are not valid as a React child. This can happen if you return a Component instead of <Component /> from render 警告:函数作为 React 子项无效。如果您返回组件而不是返回组件,则可能会发生这种情况<component />从渲染 - Warning: Functions are not valid as a React child.This may happen if you return a Component instead of <Component /> from render react native: 函数作为 react child 无效。如果你返回一个组件而不是一个组件,这可能会发生<component/> - react native: functions are not valid as a react child .This may happen if you return a component instead of a <component/> 对象作为 React 子项无效。 如果您打算渲染子集合,请改用数组。 如何退货? - Objects are not valid as a React child. If you meant to render a collection of children, use an array instead. How to return it? 对象作为 React 子级无效。 如果您打算渲染一组子项,请改用数组 - 错误 Solidity - React - Objects are not valid as a React child. If you meant to render a collection of children, use an array instead - Error Solidity - React
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM