Open wherehows opened 10 months ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
react-hot-toast | ❌ Failed (Inspect) | Jan 14, 2024 4:42am |
@timolins I encountered an error on Vercel with this pull request, even though there were no issues during local testing and build. It's challenging to identify the cause of the problem. Could you please help me understand the reason for this error? If modifications are necessary, your guidance would be greatly appreciated.
Summary
"toast" method's toast messages, using the "error" or "success" properties, do not apply the configured "ariaProps" options in the Toaster component. Please refer to the following link for more details.
https://github.com/timolins/react-hot-toast/issues/244
Reason
When the "error" or "success" properties of the toast function are called, the createToast function is invoked. However, the issue lies in the fact that createToast defines default values for ariaProps.
This value is causing an issue by overriding the globally set ariaProps option
Solution
Firstly, I made ariaProps an optional property for the Toast type. (62df748)
Secondly, within the createToast, I removed the ariaProps that were initially defined. (7f85f4e)
Lastly, within the store, I created a variable named 'defaultAriaProps' to ensure default values are applied to ariaProps. (https://github.com/timolins/react-hot-toast/pull/334/commits/2949993d97926c892693d119accf7c71bd81bca9)