I'm working on a sizable react-redux application. Without using a react component or useSelector hook, how can I get the state from the React Redux Toolkit store?
I have already used useSelector hook in other places in my app which is working well but now I need to make use of the state value outside my react component. I can't use useSelector outside a functional component.
I found this method online but I am not sure if it is safe to use it OR there is a better route to solve this problem.
import store from "./store"
const { var1, var2 } = store.getState();
Thanks for your support.