Skip to content

Commit

Permalink
Document NativeDragItemTypes.URL
Browse files Browse the repository at this point in the history
  • Loading branch information
gaearon committed Feb 27, 2015
1 parent 4daec53 commit 62595f9
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/API.md
Expand Up @@ -179,7 +179,7 @@ Note that, for best results, you want to use `this.getDragImageScale()`. It will
## `NativeDragItemTypes`
Provides a single constant, `NativeDragItemTypes.FILE`, that you can use as an item type for file drop targets.
Provides two constants, `NativeDragItemTypes.FILE` and `NativeDragItemTypes.URL`, that you can use as an item type for native file and URL drop targets.
## `DropEffects`
Expand Down
2 changes: 1 addition & 1 deletion docs/Walkthrough.md
Expand Up @@ -14,7 +14,7 @@ module.exports = {
};
```

These types are just string constants that are used to match compatible drag sources and drop targets. Even if you only plan to have one draggable type of items, it's still neccessary to declare a string constant for it. This makes it trivial to later add additional draggable/droppable types without rewriting half of your drag and drop code. Also, always relying on types allows us to elegantly support file drag and drop via a “builtin” `NativeDragItemTypes.FILE` type.
These types are just string constants that are used to match compatible drag sources and drop targets. Even if you only plan to have one draggable type of items, it's still neccessary to declare a string constant for it. This makes it trivial to later add additional draggable/droppable types without rewriting half of your drag and drop code. Also, always relying on types allows us to elegantly support file and URL drag and drop via a “builtin” `NativeDragItemTypes.FILE` and `NativeDragItemTypes.URL` types.

Let's make a very simple draggable component that, when dragged, represents `IMAGE`:

Expand Down
2 changes: 1 addition & 1 deletion examples/_dustbin-interesting/Container.js
Expand Up @@ -24,7 +24,7 @@ var Container = React.createClass({
{this.renderDustbin([ItemTypes.GLASS])}
{this.renderDustbin([ItemTypes.FOOD])}
{this.renderDustbin([ItemTypes.PAPER])}
{this.renderDustbin([ItemTypes.PAPER, NativeDragItemTypes.FILE])}
{this.renderDustbin([NativeDragItemTypes.FILE, NativeDragItemTypes.URL])}
</div>

<div style={{ minHeight: '2rem' }}>
Expand Down
2 changes: 1 addition & 1 deletion examples/_dustbin-interesting/index.js
Expand Up @@ -10,7 +10,7 @@ var DustbinSorted = React.createClass({
<Container />
<hr />
<p>
Several different dustbins can handle several types of items. Note that the last dustbin is special: it can also handle files from your hard drive.
Several different dustbins can handle several types of items. Note that the last dustbin is special: it can handle files from your hard drive and URLs.
</p>
</div>
);
Expand Down

0 comments on commit 62595f9

Please sign in to comment.