@CoderHaqiim
Posted
Congratulations Alyfer, on completing your project with React. I guess you used
npx create-react-app
to create your app. Well, people now prefer to use
npm create vite@latest
Also, I think you could have used an array to hold the information in the LinkButton i.e
const array = [
{id:1, url: "http1....", title: "something"}
{id:2, url: "http2....", title: "something"}
{url: "http3....", title: "something" }
{url: "http4....", title: "something" }
{url: "http5...." title: "something" }
]
Then you can use array.map() to map through the array and create a LinkButton for every element instead of having five linkButtons
{ array.map(item=>{
<LinkButton key={item.id} link={item.url} title = {item.title}>
})
}
This would help when you have a lot of LinkButtons.
Also, you can destructure your prop object. Instead of using
function app(prop).... and later calling prop.image, you could do it like this to make it easier:
function app({image, you can have more}) Now you can simply use image as your variable name instead of props.image. Nice job, by the way. Cheers! Happy coding!
Marked as helpful
@AlyferJT
Posted
@CoderHaqiim Hi there! Thanks for the feedback, i'll review the code and consider that. As you said, would be better if a have a way to handle more links, if passed. Appreciate that!