-
Notifications
You must be signed in to change notification settings - Fork 917
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
fix(AddressType): cleanup overrides #515
Conversation
I also updated viem and wagmi on this branch, and didn't run into any type issues. @technophile-04 would be good if you also had a look and check if the issue you used to encounter can happen here, maybe there's something I missed when trying to reproduce. |
Hey @sverps ! Looks good, but Found 684 errors in 42 files. |
Hmm, strange, did you do anything in particular, or did you just checkout the branch and then yarn install? Cause I didn't seem to get any errors on next:check-types |
no, just checkout -> install -> next:check-types |
I tried a bunch of different things, but can't seem to reproduce this behavior. Can you try removing your node_modules and re-run yarn install? |
It worked! I'm wondering is it only for me or for other users too. Hope we don't need to force them to remove node_modules. Let's wait a bit and see how it works for others. |
We actually already solved this at #499, So now using a different version of The solution was: separately targeting
The reason I don't like so much stricter type is because it does not go well with other tool's / libraries. As we can see in the above case even though I have the initial state set as "0x...." react's And now I have to assert it at useState : The error at Another option might be instead of asserting it at But beginners / quick tinkerers would rather just show the error on UI which wagmi / viem nicely gives you : Also if people use other libraries, for examle LOL really sorry for ranting 😂 and over-exaggerated examples, But I feel since wagmi/viem natively support overriding ( docs extending config ) I think we can do and We can mention it in our docs.scaffoldeth.io about it that we have overridden it But I completely get your points and makes full sense to me 🙌 I am up for overriding if we all come to a consensus Nevertheless, I like these changes that we are using a consistent In case if we don't override |
It worked for me directly without needing to remove |
Great points of discussion, @technophile-04 👍 On thinking a bit further, I tried to boil it down for myself what I think would be ideal:
So to conclude, I'd try and find all touch points where users would use addresses in our custom hooks and components and ensure those places to allow So in any case, no need to rush anything, I probably still need to fix return types from our hooks to return it as string. (Need to let this simmer a bit more, the stew isn't quite ready yet 🍲 😅 ) |
I did the same and everything was passing here too! |
Yup yup, I agree and this makes complete sense to me !! Thanks Samuel 🙌 |
Closed in favor of #630 |
Description
Cleanup of AddressType overrides
Additional Information
Related Issues
Fixes #514
Your ENS/address: solidixen.eth