Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/27.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Reactjs 为什么React.Fragment导致控制台错误:Results警告:React.createElement:类型无效_Reactjs - Fatal编程技术网

Reactjs 为什么React.Fragment导致控制台错误:Results警告:React.createElement:类型无效

Reactjs 为什么React.Fragment导致控制台错误:Results警告:React.createElement:类型无效,reactjs,Reactjs,我有以下资料: const MyField = class extends React.Component { ... renderField = (reduxFormFieldProps) => ( <React.Fragment> <Form.Input /> {!reduxFormFieldProps.meta.submitFailed ? null : <Form.Error /> }

我有以下资料:

const MyField = class extends React.Component {
...
  renderField = (reduxFormFieldProps) => (
    <React.Fragment>
      <Form.Input />
      {!reduxFormFieldProps.meta.submitFailed ? null :
      <Form.Error />
      }
    </React.Fragment>
  )
  render = () => (
    <ReduxFormField
      type="text"
      component={this.renderField}
    />
  );
};
const MyField=class扩展React.Component{
...
renderField=(reduxFormFieldProps)=>(
{!reduxFormFieldProps.meta.submitFailed?空:
}
)
渲染=()=>(
);
};
这是导致错误的原因:

警告:React.createElement:类型无效--应为字符串(对于内置组件)或类/函数(对于复合组件),但Get:未定义。您可能忘记了从定义组件的文件中导出组件,或者您可能混淆了默认导入和命名导入


但是,如果我将
s
更改为
s
,它可以正常工作。。。我在React.Fragment中做错了什么?

您使用的是React 16.2吗?是的。。。Fragment在我的应用程序的其他部分也可以使用,但由于某些原因,在上面的示例中不起作用。我想知道为什么未定义YREDUXFORMFIELDPROPS?请检查……它是。。。如果我使用的是
Form.Input
Form.Error
定义为?