Hey there
This looks good. Just be careful with your html. The heading elements that you've currently got in there aren't really headings. Headings should read like a table of contents and be understandable on their own.
As for typescript. You've got the right idea. Creating a Props
type. Using ReactNode
for children elements. Returning JSX.Element
from a component. Those are all the building blocks of basic react typescript. There isn't much more you can do with Typescript in a project like this as it's just a static site with no interactivity. The real benefit of typescript will com when you start building apps.
I would say that while creating the container component is good practice for typing the props, in this case that component isn't really giving you any benefit and you may as well just inline that <main>
element right in the app file.
Marked as helpful
@Sam-Guliker
Posted
@AlexKMarshall
Hi,
Thanks for the feedback, I'll keep the headings in mind for the next time. Probably just going to use different 'p' tags. The main part was just for practice, I know it's a bit to much for a project like this. I just wanted to get my feet wet with TS.
My next project is going to be bigger and using TS.
Once again thanks! :)