{"action":"created","issue":{"url":"https://api.github.com/repos/gaearon/react-dnd/issues/228","labels_url":"https://api.github.com/repos/gaearon/react-dnd/issues/228/labels{/name}","comments_url":"https://api.github.com/repos/gaearon/react-dnd/issues/228/comments","events_url":"https://api.github.com/repos/gaearon/react-dnd/issues/228/events","html_url":"https://github.com/gaearon/react-dnd/issues/228","id":94549066,"number":228,"title":"How to notify customdraglayer when isOver dropTarget","user":{"login":"eguneys","id":3844764,"avatar_url":"https://avatars.githubusercontent.com/u/3844764?v=3","gravatar_id":"","url":"https://api.github.com/users/eguneys","html_url":"https://github.com/eguneys","followers_url":"https://api.github.com/users/eguneys/followers","following_url":"https://api.github.com/users/eguneys/following{/other_user}","gists_url":"https://api.github.com/users/eguneys/gists{/gist_id}","starred_url":"https://api.github.com/users/eguneys/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eguneys/subscriptions","organizations_url":"https://api.github.com/users/eguneys/orgs","repos_url":"https://api.github.com/users/eguneys/repos","events_url":"https://api.github.com/users/eguneys/events{/privacy}","received_events_url":"https://api.github.com/users/eguneys/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-07-12T09:04:08Z","updated_at":"2015-07-12T13:50:29Z","closed_at":null,"body":"I use custom drag layer to show a custom element for drag preview. I want to change the picture when I am on some dropTarget how can I get notified of that inside custom drag layer?"},"comment":{"url":"https://api.github.com/repos/gaearon/react-dnd/issues/comments/120721783","html_url":"https://github.com/gaearon/react-dnd/issues/228#issuecomment-120721783","issue_url":"https://api.github.com/repos/gaearon/react-dnd/issues/228","id":120721783,"user":{"login":"gaearon","id":810438,"avatar_url":"https://avatars.githubusercontent.com/u/810438?v=3","gravatar_id":"","url":"https://api.github.com/users/gaearon","html_url":"https://github.com/gaearon","followers_url":"https://api.github.com/users/gaearon/followers","following_url":"https://api.github.com/users/gaearon/following{/other_user}","gists_url":"https://api.github.com/users/gaearon/gists{/gist_id}","starred_url":"https://api.github.com/users/gaearon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gaearon/subscriptions","organizations_url":"https://api.github.com/users/gaearon/orgs","repos_url":"https://api.github.com/users/gaearon/repos","events_url":"https://api.github.com/users/gaearon/events{/privacy}","received_events_url":"https://api.github.com/users/gaearon/received_events","type":"User","site_admin":false},"created_at":"2015-07-12T13:50:29Z","updated_at":"2015-07-12T13:50:29Z","body":"If you want to only use the documented API, your best bet is to fire callbacks from drop target's `componentWillReceiveProps` when its `monitor.isOver()` changes and save that state somewhere up the component tree, so your drag layer can receive it as props.\r\n\r\nIf you don't mind using the undocumented (but stable) API, each `DropTarget` component has `getHandlerId()` method on the instance. You can then use that ID to call the **undocumented** `monitor.isOverTarget(handlerId)` inside your drag layer's collecting function.\r\n\r\nRelevant code: https://github.com/gaearon/dnd-core/blob/19b7c124ad407017778c86fa9980213c4c47762e/src/DragDropMonitor.js#L102-L126\r\n\r\nNote that `isOverTarget(handlerId)` is currently undocumented."}}