ReactJS TailwindCSS Vite Responsive Mobile and Web Advice Generator
Design comparison
Solution retrospective
I was able to learn a lot of new information and use it within my project. I feel that I was able to understand APIs, fetching data and displaying it in ReactJS TailwindCSS.
Also, I received a high Lighthouse Report score with (3) 100 scores for web accessibility.
Additionally, I was proud of being able to make the hover glow on the button using a box shadow in a CSS file.
Overall, it was a fun and interesting project!
What challenges did you encounter, and how did you overcome them?I refreshed my knowledge and learned new information on various topics:
-
APIs in Website Development - An API (Application Programming Interface) enables different software applications to share information and interact with each other. It provides a set of instructions that allow software developers to access features and functions, facilitating communication between two pieces of software. The application sending the request is the client, and the application sending the response is the server.
-
Try-Catch Block - This construct handles exceptions and errors that may occur during the execution of a block of code. The
try
block contains the code that might throw an error, while thecatch
block contains the code to handle the error if it occurs. The code inside thetry
block is executed line by line. If no errors occur, thecatch
block is skipped. If an error occurs, control is transferred to thecatch
block. -
JSON Parsing - JSON (JavaScript Object Notation) parsing is the process of converting a JSON string into a JavaScript object. JSON is a data interchange format that is easy for humans to read and write. JavaScript objects allow you to easily access and manipulate the data.
-
JavaScript Object Fundamentals - An object is a collection of key-value pairs where each key is associated with a value. The values can be of any data type.
-
useEffect Hook - This hook provided by React allows you to perform side effects in function components. Side effects can include data fetching and manually changing the DOM. In this code, you want to fetch the advice data as soon as the component mounts. With
useEffect
, you ensure the data fetching happens right after the component is rendered. The empty dependency array ([]
) ensures the effect only runs once. -
useEffect Dependencies - The
useEffect
hook can take dependencies to control when the effect runs. Common dependencies include state variables, props, context values, derived values, empty arrays, and no dependencies. If you have no dependencies, the effect will run after every render.
I was able to finish all the requirements for the project!
Community feedback
- @TedJenklerPosted 4 months ago
Hi Lavollmer,
Nice project! I have a few recommendations that might help improve it further:
Responsive Design: It's essential for a good user experience, even if it might seem less exciting than other aspects of development. I suggest looking into using breakpoints like md:, lg:, and xl: to make the layout more dynamic and prevent text from stretching into a single long row on larger screens.
Code Practices: Avoid copying and pasting code from tools like ChatGPT without a thorough understanding. It's noticeable when comments and code structure appear to be generated by AI, which can affect the perceived quality of your work. It’s better to use your understanding to write code, adding only necessary comments that enhance readability.
Using Axios: While not essential, considering the use of Axios instead of Fetch can be beneficial. It offers additional features and might simplify handling HTTP requests.
I hope this feedback is helpful as you continue to develop your skills!
Best, Teodor
0@lavollmerPosted 4 months agoHi Teodor -
Thank you so much for your comments and feedback! I will work on the responsive design and adding breakpoints - I think that will help my project.
As for code practices, I do have a thorough understanding of the code I wrote from API fetching to my dynamic design. If asked, I would be able to explain every aspect of my code, and its reasoning for use. I was able to use a tool to more eloquently explain those processes and be more succinct in my project for other users.
I haven't been exposed to Axios, but I will research it.
Good luck in the future!
@TedJenkler
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