Skip to content

Commit 97a5cd3

Browse files
committed
Clarify ES6 loading, see #124
1 parent 3565b34 commit 97a5cd3

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

README.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,19 @@ This bundle is also what is loaded when installing from npm. It expects external
2222
If you want a UMD version of the latest `master` revision, you can generate it yourself from master by cloning this
2323
repository and running `$ make`. This will create umd dist files in the `dist/` folder.
2424

25-
### Installing with jspm and systemjs ES6 module loader
25+
### Exports
2626

27-
```bash
28-
$ jspm install npm:react-draggable
29-
```
30-
31-
To access the `Draggable` component in your own code, you refer to the `.default` property of the imported reference.
27+
The default export is `<Draggable>`. At the `.DraggableCore` property is `<DraggableCore>`. Here's how to use it:
3228

3329
```js
34-
import * as ReactDraggable from 'react-draggable';
35-
var Draggable = ReactDraggable.default;
36-
ReactDOM.render(<Draggable />, ...);
30+
// ES6
31+
import Draggable from 'react-draggable'; // The default
32+
import {DraggableCore} from 'react-draggable'; // <DraggableCore>
33+
import {default as Draggable, DraggableCore}; // Both at the same time
34+
35+
// CommonJS
36+
let Draggable = require('react-draggable');
37+
let DraggableCore = Draggable.DraggableCore;
3738
```
3839

3940
## Draggable

0 commit comments

Comments
 (0)