nftstorage.link
Advanced tools
Comparing version 1.0.2 to 1.1.0
{ | ||
"name": "nftstorage.link", | ||
"version": "1.0.2", | ||
"version": "1.1.0", | ||
"description": "Utilities for working with the NFT.Storage IPFS Edge Gateway", | ||
@@ -5,0 +5,0 @@ "type": "module", |
@@ -114,3 +114,5 @@ # nftstorage.link client utilities | ||
const [url, setUrl] = useState('') | ||
useEffect(async () => setUrl(await getGatewayURL(cid)), [cid]) | ||
useEffect(() => { | ||
getGatewayURL(cid).then(setUrl) | ||
}, [cid]) | ||
return url ? <a href={url}>{title}</a> : null | ||
@@ -121,3 +123,5 @@ } | ||
const [url, setUrl] = useState('') | ||
useEffect(async () => setUrl(await getGatewayURL(cid)), [cid]) | ||
useEffect(() => { | ||
getGatewayURL(cid).then(setUrl) | ||
}, [cid]) | ||
return url ? <img src={url} alt={alt} /> : null | ||
@@ -127,2 +131,4 @@ } | ||
See the full example here: https://github.com/nftstorage/react-nftstorage.link-fallback-example | ||
##### Node.js usage | ||
@@ -129,0 +135,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
34326
165