Skip to content

Commit

Permalink
fix: console.log npe in TargetBox (#3361)
Browse files Browse the repository at this point in the history
* fix: console.log npe in TargetBox

* chore: cut semver

* ci: add yarn cache step
  • Loading branch information
darthtrevino committed Feb 3, 2022
1 parent 9126544 commit 2b8b4ed
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/ci.yml
Expand Up @@ -17,6 +17,18 @@ jobs:
with:
node-version: ${{ matrix.node-version }}

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"

- uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- run: yarn version check
if: "github.actor != 'dependabot[bot]' && !contains(github.ref , 'release/') && !contains(github.head_ref , 'release/')"
name: Version Check
Expand Down
3 changes: 3 additions & 0 deletions .yarn/versions/57b90e7a.yml
@@ -0,0 +1,3 @@
releases:
react-dnd-documentation: patch
react-dnd-examples: patch
6 changes: 3 additions & 3 deletions packages/examples/src/06-other/native-files/TargetBox.tsx
Expand Up @@ -25,16 +25,16 @@ export const TargetBox: FC<TargetBoxProps> = (props) => {
}
},
canDrop(item: any) {
console.log('canDrop', item.files[0], item.items[0])
console.log('canDrop', item.files, item.items)
return true
},
hover(item: any) {
console.log('hover', item.files[0], item.items[0])
console.log('hover', item.files, item.items)
},
collect: (monitor: DropTargetMonitor) => {
const item = monitor.getItem() as any
if (item) {
console.log('collect', item.files[0], item.items[0])
console.log('collect', item.files, item.items)
}

return {
Expand Down

0 comments on commit 2b8b4ed

Please sign in to comment.