hooks icon indicating copy to clipboard operation
hooks copied to clipboard

feat(useFavicon): Allow additional dependency list for `useFavicon()` hook

Open rapsealk opened this issue 8 months ago • 2 comments

Hello, ahooks team!

First of all, thanks for maintaining this project.

🤔 This is a ...

  • [x] New feature

💡 Background and solution

I have encountered several cases where the favicon doesn't update when the source URL changes. This pull request addresses that issue by allowing an additional deps?: React.DependencyList argument for the useFavicon() hook. This enhancement ensures that the favicon updates properly when the dependencies change.

📝 Changelog

Language Changelog
🇺🇸 English Allow additional deps?: React.DependencyList argument for the useFavicon() hook.
🇨🇳 Chinese 允许为 useFavicon() hook 添加额外的 deps?: React.DependencyList 参数。(Translated by ChatGPT)

☑️ Self Check before Merge

⚠️ Please check all items below before review. ⚠️

  • [ ] Doc is updated/provided or not needed
  • [x] Changelog is provided or not needed

I appreciate your feedback in advance.

rapsealk avatar Mar 11 '25 08:03 rapsealk

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Mar 11 '25 08:03 CLAassistant

In what situations will the favicon not be updated when the URL changes, and it would be best to have a reproducible demo. I don't quite approve of the way you're making this change now.

crazylxr avatar Jun 02 '25 10:06 crazylxr