hooks
hooks copied to clipboard
feat(useFavicon): Allow additional dependency list for `useFavicon()` hook
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.
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.