I have this javascript file which is containing styles in an object for a React app:
const styles = {
  fonts: {
    Georgia: 'Georgia, \'Times New Roman\', Times, serif',
  },
  App: {
    textAlign: 'center',
    fontFamily: this.fonts.Georgia,
  },
};
module.exports = styles;
fontFamily: this.fonts.Georgia would reference App: { fonts: '' } object, but what I want to do is to access the already defined fonts object inside styles. How can I do that?
What works is:
const fonts = {
  Georgia: 'Georgia, \'Times New Roman\', Times, serif',
};
const styles = {
  App: {
    textAlign: 'center',
    fontFamily: fonts.Georgia,
  },
};
module.exports = styles;
This is works in this case, but the upper solution would be much nicer.
 
     
    