{"action":"closed","issue":{"url":"https://api.github.com/repos/ElemeFE/element-react/issues/965","repository_url":"https://api.github.com/repos/ElemeFE/element-react","labels_url":"https://api.github.com/repos/ElemeFE/element-react/issues/965/labels{/name}","comments_url":"https://api.github.com/repos/ElemeFE/element-react/issues/965/comments","events_url":"https://api.github.com/repos/ElemeFE/element-react/issues/965/events","html_url":"https://github.com/ElemeFE/element-react/issues/965","id":427389482,"node_id":"MDU6SXNzdWU0MjczODk0ODI=","number":965,"title":"自定义容器组件与element-react的table组件，context冲突","user":{"login":"andyyxw","id":41931722,"node_id":"MDQ6VXNlcjQxOTMxNzIy","avatar_url":"https://avatars3.githubusercontent.com/u/41931722?v=4","gravatar_id":"","url":"https://api.github.com/users/andyyxw","html_url":"https://github.com/andyyxw","followers_url":"https://api.github.com/users/andyyxw/followers","following_url":"https://api.github.com/users/andyyxw/following{/other_user}","gists_url":"https://api.github.com/users/andyyxw/gists{/gist_id}","starred_url":"https://api.github.com/users/andyyxw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andyyxw/subscriptions","organizations_url":"https://api.github.com/users/andyyxw/orgs","repos_url":"https://api.github.com/users/andyyxw/repos","events_url":"https://api.github.com/users/andyyxw/events{/privacy}","received_events_url":"https://api.github.com/users/andyyxw/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"loadchange","id":10842824,"node_id":"MDQ6VXNlcjEwODQyODI0","avatar_url":"https://avatars2.githubusercontent.com/u/10842824?v=4","gravatar_id":"","url":"https://api.github.com/users/loadchange","html_url":"https://github.com/loadchange","followers_url":"https://api.github.com/users/loadchange/followers","following_url":"https://api.github.com/users/loadchange/following{/other_user}","gists_url":"https://api.github.com/users/loadchange/gists{/gist_id}","starred_url":"https://api.github.com/users/loadchange/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/loadchange/subscriptions","organizations_url":"https://api.github.com/users/loadchange/orgs","repos_url":"https://api.github.com/users/loadchange/repos","events_url":"https://api.github.com/users/loadchange/events{/privacy}","received_events_url":"https://api.github.com/users/loadchange/received_events","type":"User","site_admin":false},"assignees":[{"login":"loadchange","id":10842824,"node_id":"MDQ6VXNlcjEwODQyODI0","avatar_url":"https://avatars2.githubusercontent.com/u/10842824?v=4","gravatar_id":"","url":"https://api.github.com/users/loadchange","html_url":"https://github.com/loadchange","followers_url":"https://api.github.com/users/loadchange/followers","following_url":"https://api.github.com/users/loadchange/following{/other_user}","gists_url":"https://api.github.com/users/loadchange/gists{/gist_id}","starred_url":"https://api.github.com/users/loadchange/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/loadchange/subscriptions","organizations_url":"https://api.github.com/users/loadchange/orgs","repos_url":"https://api.github.com/users/loadchange/repos","events_url":"https://api.github.com/users/loadchange/events{/privacy}","received_events_url":"https://api.github.com/users/loadchange/received_events","type":"User","site_admin":false}],"milestone":null,"comments":0,"created_at":"2019-03-31T12:08:36Z","updated_at":"2019-05-16T11:01:13Z","closed_at":"2019-05-16T11:01:13Z","author_association":"NONE","body":"引入react-redux后，将组件分离为改为presentational和container两种组件，但是在渲染组件时出现了下面的警告：\r\n```\r\nWarning: Failed context type: The context `store.subscribe` is marked as required in `Connect(Update)`, but its value is `undefined`.\r\n    in Connect(Update) (created by TableBody)\r\n```\r\n经过一番折腾，发现是自定义的container组件Update的context中的store，被它的父组件element-react的Table的context中的store顶掉了。\r\n自定义容器组件：直接在App标签中渲染updater组件，context的store为Redux的store.\r\n![image](https://user-images.githubusercontent.com/41931722/55288858-60a20c80-53f0-11e9-8cdd-a17afb6dca24.png)\r\n第三方库方式：updater组件包含在element-react的Table组件中，context的store却是TableStore.\r\n![image](https://user-images.githubusercontent.com/41931722/55288864-76173680-53f0-11e9-9e5e-bde5d7c8cacb.png)\r\n严重警告代码出处：./presentational/content.js\r\n```\r\nimport React, { Component } from 'react';\r\nimport { Table } from 'element-react';\r\nimport { connect } from 'react-redux';\r\nimport Update from '../containers/update';\r\n\r\nclass Content extends Component {\r\n    constructor(props,context) {\r\n        super(props);\r\n        this.state = {\r\n            columns: [\r\n                {\r\n                    label: '用户名',\r\n                    prop: 'name'\r\n                },\r\n                {\r\n                    label: '操作',\r\n                    prop: 'zip',\r\n                    fixed: 'right',\r\n                    width: 240,\r\n                    render: (row, column, index)=>{\r\n                      return (\r\n                            <div>\r\n                                <Update/>\r\n                            </div>\r\n                        );\r\n                    }\r\n                }\r\n            ],\r\n            data: [{\r\n                date: '2016-05-02',\r\n                name: '王小虎',\r\n                province: '上海',\r\n                city: '普陀区',\r\n                address: '上海市普陀区金沙江路 1518 弄',\r\n                zip: 200333\r\n              }]\r\n        };\r\n    }\r\n    render () {\r\n        return (\r\n            <div className=\"Content\">        \r\n                <Table\r\n                    style={{width: '100%'}}\r\n                    columns={this.state.columns}\r\n                    data={this.state.data}\r\n                >\r\n                </Table>\r\n                <Update />\r\n            </div>\r\n        );\r\n    }\r\n}\r\nexport default Content;\r\n```\r\n\r\n请问该怎么解决？不胜感激"}}
{"actor":{"display_login":"hazel54"}}