Skip to content
Compare
Choose a tag to compare
@jnsdls jnsdls released this 21 Nov 18:10
· 7 commits to main since this release
d665684

Minor Changes

  • #5388 901c3a1 Thanks @kien-ngo! - Add headless UI component: Account (Name, Image, Address, Balance)

  • #5374 0e5d120 Thanks @joaquim-verges! - # Breaking change

    We are making the following changes to the NFT component to provide better performance and fine-grain control over their internal fetching logic.
    Moreover, you no longer have to wrap React.Suspense around said components!

    Old

    <NFT>
      <React.Suspense fallback={"Loading stuff..."}>
        <NFT.Media />
        <NFT.Name />
        <NFT.Description />
      </React.Suspense>
    </NFT>

    New

    The new version comes with 2 new props: loadingComponent and fallbackComponent.
    Basically, loadingComponent takes in a component and show it while the internal fetching is being done
    fallbackComponent takes in a component and show it once the data is failed to be resolved

    <NFTProvider contract={contract} tokenId={0n}>
        <NFTMedia
          loadingComponent={<span>Loading NFT Image</span>}
          fallbackComponent={<span>Failed to load NFT</span>}
        />
        <NFTDescription
          loadingComponent={<span>Loading NFT Description</span>}
          fallbackComponent={<span>Failed to load NFT Description</span>}
        />
    </NFT>

Patch Changes