Design comparison
Solution retrospective
Hi there, that's my first React project, any feedbacks would be great
Community feedback
- @CoderHaqiimPosted 9 months ago
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 usenpm 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 helpful1@AlyferJTPosted 9 months ago@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!
1
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord