{"action":"created","issue":{"url":"https://api.github.com/repos/react-dnd/react-dnd/issues/698","repository_url":"https://api.github.com/repos/react-dnd/react-dnd","labels_url":"https://api.github.com/repos/react-dnd/react-dnd/issues/698/labels{/name}","comments_url":"https://api.github.com/repos/react-dnd/react-dnd/issues/698/comments","events_url":"https://api.github.com/repos/react-dnd/react-dnd/issues/698/events","html_url":"https://github.com/react-dnd/react-dnd/issues/698","id":214699993,"number":698,"title":"Is any call monitor.getItemType() return null at the beginDrag function call","user":{"login":"lcoder","id":5225853,"avatar_url":"https://avatars1.githubusercontent.com/u/5225853?v=3","gravatar_id":"","url":"https://api.github.com/users/lcoder","html_url":"https://github.com/lcoder","followers_url":"https://api.github.com/users/lcoder/followers","following_url":"https://api.github.com/users/lcoder/following{/other_user}","gists_url":"https://api.github.com/users/lcoder/gists{/gist_id}","starred_url":"https://api.github.com/users/lcoder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lcoder/subscriptions","organizations_url":"https://api.github.com/users/lcoder/orgs","repos_url":"https://api.github.com/users/lcoder/repos","events_url":"https://api.github.com/users/lcoder/events{/privacy}","received_events_url":"https://api.github.com/users/lcoder/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-03-16T13:13:47Z","updated_at":"2017-03-18T10:31:38Z","closed_at":null,"body":"what I'm code:\r\n```javascript\r\nimport ItemTypes from 'macro/ItemTypes' ;\r\n\r\nconst dragSource = {\r\n    beginDrag( props , monitor ){\r\n        let itemType = monitor.getItemType() ;\r\n        console.log( itemType ) ;  // always return null whatever I drag any dragsource\r\n        // cell 拖拽\r\n        if( itemType == ItemTypes.EXIST_CARD ){\r\n            let position = props.position ,\r\n                arrayIndex = props.arrayIndex ;\r\n            return {\r\n                type: 'reRank' ,\r\n                position ,\r\n                arrayIndex\r\n            }\r\n        }else if( itemType == ItemTypes.ROWCARD ){\r\n            return {} ;\r\n        }else{\r\n            console.warn( '未定义拖拽源' , itemType ) ;\r\n            return {} ;\r\n        }\r\n    } ,\r\n    canDrag( props , monitor ){\r\n        let itemType = monitor.getItemType() ;\r\n        let item = monitor.getItem() ;\r\n        console.log( itemType )\r\n        if( props.obj ){                // DragInner已经绑定了一个对象 （ 表单控件 描述对象 ）\r\n            return true ;\r\n        }else{\r\n            return false ;\r\n        }\r\n    }\r\n}\r\nexport default dragSource ;\r\n```\r\nAt beginDrag function console.log( itemType ) always return null .what evet I drag EXIST_CARD or ROWCARD dragSource . \r\n\r\nDragSource:\r\n```javascript\r\n@DragSource( ItemTypes.EXIST_CARD , dragSource , ( connect , monitor )=>{\r\n    return {\r\n        connectDragSource: connect.dragSource() \r\n    }\r\n} )\r\nexport default class DragInner extends Component {\r\n    static propTypes = {\r\n        connectDropTarget: PropTypes.func.isRequired\r\n    }\r\n    constructor(props) {\r\n      // ...\r\n    }\r\n    render() {\r\n       // ...\r\n        return connectDragSource(\r\n            connectDropTarget(\r\n              <div className={className} style={{\r\n                    minHeight: '30px' ,\r\n                    backgroundColor ,\r\n                }} onClick={this.handleClick}>\r\n                { /*hasDropped && <span>dropped {hasDroppedOnChild && ' on child'}</span>*/ }\r\n                { modelToReact( obj ) }\r\n              </div>\r\n            )\r\n        ) ;\r\n    }\r\n}\r\n```\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/react-dnd/react-dnd/issues/comments/287533857","html_url":"https://github.com/react-dnd/react-dnd/issues/698#issuecomment-287533857","issue_url":"https://api.github.com/repos/react-dnd/react-dnd/issues/698","id":287533857,"user":{"login":"lcoder","id":5225853,"avatar_url":"https://avatars1.githubusercontent.com/u/5225853?v=3","gravatar_id":"","url":"https://api.github.com/users/lcoder","html_url":"https://github.com/lcoder","followers_url":"https://api.github.com/users/lcoder/followers","following_url":"https://api.github.com/users/lcoder/following{/other_user}","gists_url":"https://api.github.com/users/lcoder/gists{/gist_id}","starred_url":"https://api.github.com/users/lcoder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lcoder/subscriptions","organizations_url":"https://api.github.com/users/lcoder/orgs","repos_url":"https://api.github.com/users/lcoder/repos","events_url":"https://api.github.com/users/lcoder/events{/privacy}","received_events_url":"https://api.github.com/users/lcoder/received_events","type":"User","site_admin":false},"created_at":"2017-03-18T10:31:38Z","updated_at":"2017-03-18T10:31:38Z","body":"@anilreddykatta I clear.Thanks!😄"}}
{"actor":{"display_login":"lcoder"}}