Javascript – How to access state in public file in React.JS?
I have implemented firebase background notification messages, therefore I had to put firebase-messaging-sw.js file in public folder. I need to access state, which determines language of the website inside firebase-messaging-sw.js. I am using useContext to manage state. Here is the…