I tried asking this on StackOverflow, but people started scratching their heads wondering how I was loading these files (people not familiar with Meteor, apparently)
So, my issue:
Iāve got one file, letās say cat.jsx:
class Cat {
constructor() {
this.name = 'Fluffy';
}
}
And in another file, main.jsx, if I reference Cat I get an error that itās not defined:
cat = new Cat();
How do I make the Cat class globally visible? I want some modularity to my project.
Sorry, misuse of terms. By modularity I just meant having my class in its own file. I realize that having something modular is the opposite of occupying the global space.
Doesnāt this go against the Meteor way of doing things? (i.e., letting it handle the loading files) Thereās no other way to do this?