useJustaName
Usage
import { useJustaName } from '@justaname.id/react'
function MyComponent() {
const { justaname, chainId, backendUrl } = useJustaName()
const handleAction = async () => {
if (justaname) {
// Use the justaname service instance
const result = await justaname.subnames.getSubname({
subname: 'alice.justaname.eth',
chainId: 1
})
console.log('Result:', result)
}
}
return (
<div>
<h3>JustaName Service</h3>
<p>Chain ID: {chainId}</p>
<p>Backend URL: {backendUrl}</p>
<button onClick={handleAction}>
Get Subname
</button>
</div>
)
}Returns
Throws
Defined in
Last updated