I have file which exports various utility functions to use across components, and these functions needs to access redux state. How do I import the state object to this file?
connect
does not work here if your utility functions are not react
elements.
Best idea is, import create store and then use getState
function,
import store from 'store/createStore';
const state = store.getState();