Reactjs 未捕获类型错误:无法读取属性';地图';react redux网格中未定义的

Reactjs 未捕获类型错误:无法读取属性';地图';react redux网格中未定义的,reactjs,tree,grid,redux,Reactjs,Tree,Grid,Redux,我想通过react-redux网格创建一个树网格。但是我得到了错误:uncaughttypeerror:无法读取未定义的属性“map” 我是按照指示去做的 不确定出了什么问题,代码如下: import { Grid } from 'react-redux-grid'; export const Tree = ({ store }) => { const dataSource = { data: [ { id: 11,

我想通过react-redux网格创建一个树网格。但是我得到了错误:uncaughttypeerror:无法读取未定义的属性“map”

我是按照指示去做的

不确定出了什么问题,代码如下:

import { Grid } from 'react-redux-grid';
export const Tree = ({ store }) => {
const dataSource = {
      data: [
        {
            id: 11,
            parentId: 1,
            name: 'Category 11',
            editable: false,
            leaf: true,
            categoryCode: '12jf-3h3h-11'
        }
      ],
      partial: true
}

const data = {
    root: {
        id: -1,
        parentId: null,
        children: [
            {
                id: 1,
                parentId: -1,
                name: 'Category 1',
                categoryCode: 'as-ffw-34neh-',
                editable: true,
                children: [
                    {
                        id: 12,
                        parentId: 1,
                        leaf: false // there are children for this record that haven't been fetched yet
                        // ... rest of data
                    },
                    {
                        id: 13,
                        parentId: 1
                        // ... rest of data
                    }
                ]
            }
        ]
    }
}

const treeConfig = {
    stateKey: 'tree-grid-1',
    gridType: 'tree', // either `tree` or `grid`,
    showTreeRootNode: false, // dont display root node of tree
    columns: [
        {
            dataIndex: 'category',
            name: 'Category',
            expandable: true // this will be the column that shows the nested hierarchy
        },
        {
            dataIndex: 'categoryCode',
            name: 'Category Code',
            expandable: true // can be set on multiple columns
        },
        {
            dataIndex: 'editable',
            name: 'Editable',
            expandable: false // will be displayed as flat data
        }
    ],
    data: data
    dataSource: dataSource
};

    return (
    <Grid { ...treeConfig } />
    );
}

//another page
let React = require('react');
import thunk from 'redux-thunk';
import Tree from '../Tree.jsx';
const reducers = {
 //some reducers here
}
const store = createStore(reducer,applyMiddleware(thunk));
 let gridPage = React.createClass({
 render: function() {
  return(
   <Provider store={store}>
    <Tree store={store} />
   </Provider>
  )
}
});
从'react redux Grid'导入{Grid};
导出常量树=({store})=>{
常量数据源={
数据:[
{
id:11,
父ID:1,
名称:“第11类”,
可编辑:false,
叶:是的,
类别代码:“12jf-3H-11”
}
],
部分:正确
}
常数数据={
根目录:{
id:-1,
parentId:null,
儿童:[
{
id:1,
父ID:-1,
名称:“类别1”,
类别代码:“as-ffw-34neh-”,
是的,
儿童:[
{
id:12,
父ID:1,
leaf:false//此记录的子项尚未提取
//…其余数据
},
{
id:13,
父ID:1
//…其余数据
}
]
}
]
}
}
常量树图={
stateKey:'tree-grid-1',
gridType:'tree',//或者'tree'或者'grid`,
showTreeRootNode:false,//不显示树的根节点
栏目:[
{
dataIndex:'类别',
名称:'类别',
expandable:true//这将是显示嵌套层次结构的列
},
{
dataIndex:“categoryCode”,
名称:'类别代码',
可扩展:true//可在多个列上设置
},
{
数据索引:“可编辑”,
名称:“可编辑”,
可扩展:false//将显示为平面数据
}
],
数据:数据
数据源:数据源
};
返回(
);
}
//另一页
让反应=要求(‘反应’);
从“redux thunk”导入thunk;
从“../Tree.jsx”导入树;
常数减缩器={
//这里有些减速机
}
const store=createStore(reducer,applyMiddleware(thunk));
让gridPage=React.createClass({
render:function(){
返回(
)
}
});

您正在映射什么?添加地图代码添加地图代码,谢谢!我的意思是添加实际执行映射的代码。显示具有map函数调用的代码