I am making multiple components in an effort to essentially have one base component that I maintain whilst also making it easier to read when editing the text.
Could someone take a look at my approach and critique if I am doing anything wrong by doing this? Would the preferred method be to use props since I am using alot of text?
#Nesting components
1 messages · Page 1 of 1 (latest)
This is the alternative and this is great however at the moment my content is in the html itself and I like working more with components like the one above. I think its easier to understand. Anyways, please let me know your thoughts because I want to get better at using astro and typically I do use nested components in react itself
The issue I am facing is just that I need like 6 files for a single component and Id prefer it in one single file I just cant do that with astro if I am correct.
I'm no expert but I'll give my 2 cents. Others may disagree. But I think the approach you want depends on the complexity of your code.
I've seen projects that have used a 200 line of code file for one thing and a similar project that will break up that 200 lines of code into like six files...some files with only a couple lines of code.
You may want to research SOLID principles for deciding when to make a new component and when to keep everything in one file. This might be a good resource(https://www.everydayreact.com/articles/solid-principles-in-react).
Sorry I'm not much help but in the simplest program, like your example, I would keep everything in one file myself