Skip to content

Commit 306ca72

Browse files
committed
Clarify the import in docs
Fixes #263
1 parent 95cfd15 commit 306ca72

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

docs/00 Quick Start/Tutorial.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -922,6 +922,11 @@ Finally, I'm adding a `canMoveKnight` check to the `handleSquareClick` method:
922922

923923
-------------------
924924
```js
925+
var canMoveKnight = require('./Game').canMoveKnight;
926+
var moveKnight = require('./Game').moveKnight;
927+
928+
/* ... */
929+
925930
handleSquareClick: function (toX, toY) {
926931
if (canMoveKnight(toX, toY)) {
927932
moveKnight(toX, toY);
@@ -930,6 +935,10 @@ handleSquareClick: function (toX, toY) {
930935
```
931936
-------------------
932937
```js
938+
import { canMoveKnight, moveKnight } from './Game';
939+
940+
/* ... */
941+
933942
handleSquareClick(toX, toY) {
934943
if (canMoveKnight(toX, toY)) {
935944
moveKnight(toX, toY);
@@ -1832,4 +1841,4 @@ Happy dragging and dropping.
18321841
18331842
<img src='https://s3.amazonaws.com/f.cl.ly/items/1F2g2F0D470X0d0k2A1U/Screen%20Recording%202015-05-15%20at%2002.22%20pm.gif' width='404' height='445' alt='Screenshot'>
18341843
1835-
Now go and [play with it](examples-chessboard-tutorial-app.html)!
1844+
Now go and [play with it](examples-chessboard-tutorial-app.html)!

0 commit comments

Comments
 (0)