Reactjs:警告:React.createElement:类型不应为null或未定义

非:

这是完整的错误

警告:React.createElement:type不能为null或未定义。它应该是一个字符串(对于DOM元素)或一个ReactClass(对于复合组件)。

这就是我所拥有的一切

import React, { Component } from 'react';
import Router, {Link, RouteHandler} from 'react-router';
import { Grid, Row, Column, List, ListItem } from '../../components/Layout';
import { RaisedButton, Paper } from 'material-ui';

const videosInformation = {
  time      : 25,
  gameId    : 15665,
  date      : '12 10 2015',
  gameName  : "Black Jack"
};

export default class Home extends Component {

  static contextTypes = {
    router  : React.PropTypes.func
  }  

  render () {
    return <Grid>                   
      <Row>
        <Column>
          <Paper>
            <List subheader="Player Info">
              <ListItem primaryText={`Name: ${videosInformation.time}`} />
              <ListItem primaryText={`Nickname: ${videosInformation.date}`} />
              <ListItem primaryText={`Age: ${videosInformation.gameId}`} />
              <ListItem primaryText={`Language: ${videosInformation.gameName}`} />
            </List>
          </Paper>
        </Column>  
        <Column>
          <iframe width="560" height="315" src="https://www.youtube.com/embed/Ta4xuThmAsQ" frameBorder="0" allowFullScreen></iframe>
        </Column>
      </Row>
    </Grid>;
  };

}

我正在使用Material-UI

Ed Ballot:

您的Layout文件可能没有从这一行导出变量之一

import { Grid, Row, Column, List, ListItem } from '../../components/Layout';

如果未定义警告之一,则会发生警告。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

未定义React

警告:React.createElement:类型不能为null或未定义

ReactJS-警告:React.createElement:类型不应为null

ReactJS react-google-maps未定义

React未定义(无法读取未定义的属性“ createElement”)

警告:React.createElement:类型在React Native Picker中无效

React无法将未定义或null转换为对象

在React Native中获取类型错误未定义对象?

警告:React.createElement:类型无效-bundle.js

'this'是未定义的-ReactJS

React.createElement:类型无效-预期为字符串(对于内置组件)或类/函数(对于复合组件),但未定义

(警告:React.createElement:类型无效)React Native Error

ReactJS道具未定义

index.js:1警告:React.createElement:类型无效

Reactjs,这是未定义的

React.createElement:type不能为null或未定义

React.createElement:type不能为null,未定义。.创建/渲染组件时

SWIG:如何使用%apply返回结构?“未定义类型映射”警告

熊猫运行时警告无法将类型“时间戳”与类型“ str”进行比较,未定义对象的排序顺序未定义

React createElement类型不应为null /未捕获的不变违规

React 组件错误未定义但应返回 null

反应:警告:道具类型失败:无法读取未定义的属性“应用”

类型错误:_this2 是未定义的 REACTJS

[Vue 警告]:渲染错误:“TypeError:无法读取未定义的属性‘类型’”

无法读取未定义的属性“类型”-react-redux

类型错误:未定义不是对象 - React Native

类型错误:无法读取未定义 ReactJs 的属性“_id”?

React UseState 函数中的 TS2322:Dispatch<SetStateAction<MyDataType[] | 未定义>> 不应该是未定义的

类型错误:使用 React Hooks 未定义电影