Join GitHub today
Fix for "Browser console warning when beginning checkout" #3980
Receive the following warning in the browser console when clicking on the "checkout" button from the PDP. Also a spinner is shown for a beat or two. Seems to have no effect on actual functionality.
Note that this issue does not occur on every machine. It happen's reliably on Brent's machine, though. I was able to replicate it after playing with setTimeout times.
Solution / Changes
Don't call setState in a timer without prior check of mount state.
Yes, this is the approach we've been using. Technically every setState that's in a callback or promise chain should be wrapped in the isMounted check. For example, the one in the