Skip to content
This repository was archived by the owner on Jun 4, 2025. It is now read-only.

Commit a295c4d

Browse files
authored
fix: update examples to run with latest js-ipfs (#232)
Updates all examples to the latest deps
1 parent c2ef51e commit a295c4d

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,19 +36,20 @@
3636
"@testing-library/jest-dom": "^5.14.1",
3737
"@testing-library/react": "^12.1.2",
3838
"@testing-library/user-event": "^13.5.0",
39-
"dot-prop": "^6.0.1",
40-
"ipfs-core": "^0.12.2",
39+
"dot-prop": "^7.1.1",
40+
"ipfs-core": "^0.14.0",
4141
"ipfs-css": "^1.3.0",
4242
"react": "^17.0.2",
4343
"react-dom": "^17.0.2",
44-
"react-scripts": "4.0.3",
44+
"react-scripts": "5.0.0",
4545
"tachyons": "^4.12.0",
4646
"web-vitals": "^2.1.2"
4747
},
4848
"devDependencies": {
4949
"@playwright/test": "^1.12.3",
5050
"playwright": "^1.12.3",
5151
"rimraf": "^3.0.2",
52-
"test-util-ipfs-example": "^1.0.2"
52+
"test-util-ipfs-example": "^1.0.2",
53+
"util": "^0.12.4"
5354
}
5455
}

src/hooks/use-ipfs.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useState, useEffect } from 'react'
2-
import dotProp from 'dot-prop'
2+
import { getProperty } from 'dot-prop'
33
// dot-prop: used to obtain a property of an object when the name of property is a string
44
// here we get ipfs.id when calling dotProp.get(ipfs, cmd), with cmd = 'id'
55
// and we get ipfs.hash when calling with cmd = 'hash' etc.
@@ -22,7 +22,7 @@ export default function useIpfs (ipfs, cmd, opts) {
2222
async function callIpfs (ipfs, cmd, setRes, ...opts) {
2323
if (!ipfs) return null
2424
console.log(`Call ipfs.${cmd}`)
25-
const ipfsCmd = dotProp.get(ipfs, cmd)
25+
const ipfsCmd = getProperty(ipfs, cmd)
2626
const res = await ipfsCmd(...opts)
2727
console.log(`Result ipfs.${cmd}`, res)
2828
setRes(res)

0 commit comments

Comments
 (0)