-
Notifications
You must be signed in to change notification settings - Fork 286
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
JS console error appears when pressing "Set up now" on the GA4 Activation Banner #5760
Comments
Hey @jimmymadon - good shout on the use of I've spotted another place where we could conceivably see the same error occurring. As I mean it's slighlty preemptive as it's not the specific call that causes the error, but would save us detective work if this one does come and bite us in future...
|
@techanvil Nice catch - have updated the PR! |
Nice one @jimmymadon. IB ✅ |
QA Update: ✅Verified:
Note: Currently, the zero and gathering data state notifications are not working due to the bug in #5148 which is currently being worked on. I checked to make sure the other banner notifications appeared. |
Bug Description
When pressing the Set up now button on the GA4 Activation Banner an error appears in the JS console. See screenshots below.
Steps to reproduce
googlesitekit_analytics-4_settings
WordPress option. Session storage may also need to be cleared.Screenshots
1. Press Set up now.
2. The banner successfully moves to the next stage, but an error appears in the console:
Additional Context
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
Implementation Brief
BannerNotification/index.js
, use theuseMountedState()
hook fromreact-use
which returns a function that will check if the component is mounted or not.handleCTAClick()
, use this function to wrap the state updatesetIsAwaitingCTAResponse( false );
which should only happen if the component is mounted. (The error occurs on this line as the line before changes thestep
state variable in theActivationBanner
component causing the child components to re-render).Test Coverage
QA Brief
Changelog entry
The text was updated successfully, but these errors were encountered: