Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: Documentation for useEnsAvatar uses "address" #2765

Closed
1 task done
MidnightLightning opened this issue Jul 19, 2023 · 3 comments · Fixed by #2770
Closed
1 task done

bug: Documentation for useEnsAvatar uses "address" #2765

MidnightLightning opened this issue Jul 19, 2023 · 3 comments · Fixed by #2770
Labels
Good First Issue Misc: Good First Issue

Comments

@MidnightLightning
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Package Version

1.3

Current Behavior

I copy/paste the examples from the useEnsAvatar documentation page.

Expected Behavior

I expect them to compile and run successfully

Steps To Reproduce

Example from documentation:

import { useEnsAvatar } from 'wagmi'

function App() {
  const ensAvatar = useEnsAvatar({
    address: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',
    chainId: 1,
  })
}

Link to Minimal Reproducible Example (StackBlitz, CodeSandbox, GitHub repo etc.)

No response

Anything else?

The issue is the documentation gives incorrect examples. The documentation at https://wagmi.sh/react/hooks/useEnsAvatar indicates that function needs to have a name supplied to it as the key determining thing to look up, but then other examples go on to use address as an option for what to look up. The underlying viem getEnsAvatar function doesn't take address, and the Typescript compilation fails if address is used.

@tmm
Copy link
Member

tmm commented Jul 19, 2023

Feel free to update the documentation! Usually takes less time to do that than create a bug.

@tmm tmm added the Good First Issue Misc: Good First Issue label Jul 19, 2023
@MidnightLightning
Copy link
Author

Feel free to update the documentation! Usually takes less time to do that than create a bug.

I know I can submit a pull request for the documentation update. However, it's unclear to me whether this was a mistake in the implementation (a bug that the intended method of using it doesn't work) or documentation (the feature's not going to change, and the documentation needs to change), so hence filing an issue so it could be discussed and properly acted upon.

Copy link
Contributor

github-actions bot commented Jan 8, 2024

This issue has been locked since it has been closed for more than 14 days.

If you found a concrete bug or regression related to it, please open a new bug report with a reproduction against the latest wagmi version. If you have any other comments you can create a new discussion.

@github-actions github-actions bot locked and limited conversation to collaborators Jan 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Good First Issue Misc: Good First Issue
Projects
None yet
2 participants