Hello all. I’ve been working on a headless Wordpress project as a way to explore ReactJS and use it as portfolio material. I’ve been going through the Step-by-Step tutorial, which is clear, except for one thing: where exactly do you use npx frontity create hello-frontity
?
With this project, I am using a standard Wordpress directory structure, so not Bedrock or anything like that. Since I thought, “I’m using React for making a theme,” I went into /wp-content/themes
and used the create command there. But is that really where I should be creating this? Before finding Frontity, I was following a 2-year old tutorial that was a crash course on React and the Wordpress API, and it placed all ReactJS stuff in a top-level directory called “front-end.” I was unsure about that, but maybe that’s also how Frontity is structured?
Is this dependent upon whether or not I’m running Frontity in decoupled or embedded mode? Since I am new to combining ReactJS with Wordpress, is there some other concept or architecture layout that I’m missing? Or perhaps it doesn’t matter at all, and it’s fine to have it within a theme directory? (Though it does feel odd having it be /wp-content/themes/astrographer/packages/astrographer
. Then again, React does love reusing words all the time, so…)
So possibly a dumb question, but how do you structure your Frontity projects?