I'm so sorry not seeing your comment before... I think that maybe the setState function is not updating the state before calling the post message function ( reactjs.org/docs/state-and-lifecyc...).
Or if it's an old version, maybe the create-react-app doesn't create the service-worker file with postMessage function and you must configure the webpack configuration manually
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I'm so sorry not seeing your comment before... I think that maybe the setState function is not updating the state before calling the post message function ( reactjs.org/docs/state-and-lifecyc...).
Or if it's an old version, maybe the create-react-app doesn't create the service-worker file with postMessage function and you must configure the webpack configuration manually