@Kijimai
Posted
Overall the rating component works wonderfully. If you do want to center the component on the page, you can set a parent container as the flex parent with
.flex_parent {
display: flex;
justify-content: center;
align-items: center;
}
in this case, you could set the body element as the flex parent since this is an isolated project that only houses one component. On the other hand, you could set a dedicated parent container like a <div> as the flex parent and set it to this:
.some_flex_parent {
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
}
setting the min-height of this parent element to 100vh ensures that it takes up the entire vertical width of the page to center the component properly.
As for your script, it's best practice to use const rather than let to store variables that you do not want changed.
Overall, nice work!
Marked as helpful