I am trying to export a variable that gets updated from state. The challenge I have is that I cannot modify how the variable is being exported, as it is being used in way too many files at the moment.
Maybe can call the function from another file to execute?
import { useAppDispatch, useAppSelector } from "../redux/hooks";
export const Content = () => {
const { store } = useAppSelector((state) => state.StoreReducer);
return store;
};
export const currency =
Content() && Content()?.currency ? Content()?.currency : "USD";
export default {
CURRENCY: currency}
React Error:
Invalid hook call. Hooks can only be called inside of the body of a function component.