First problem building a React web-app
I started programming sometime ago with basic stuff like pure HTML as CSS, then started learning PHP to handle data, insert and fetch data from database, login system and contact form.
Recently I engaged in a JavaScript course, from basic to more advanced topics. After a while a realized that I want some challenge in JavaScript (because document.getElementById and add onclick events were too easy) and started creating a ReactJS app using the HTML and CSS concepts that I already know and also implementing the JS knowledge that I’ve already got.
(I’ll add future posts about the Web-app creation)
So, let’s get started in the part that really got me frustrated today and made me stop developing the app today and continue tomorrow.
As I was developing the ReactJS part today I’ve encountered a simple issue: props.match.params.id wasn’t printing the ID from the product that I wanted in the console. I started searching on the web on how to solve this problem and all the instructions wasn’t solving my problem, I’ve tried a bunch of them! After a while I succumbed and decided to open a new question on StackOverflow, surprisingly I’ve got two answers and only of them was, probably, the correct one and I’ll try it tomorrow, because I was so upset today that I didn’t want to see that code anymore!
React-router-dom is a great feature to work with, it makes a lot easier to route pages inside the app and don’t require a lot of work to make it happen!
But if you use some help from 1 or 2 years ago may it not work because of the updates, like it did happen with me.
Tomorrow I’ll start sharing the construction process of the web app, from scratch and until I finish this project.
Hope you guys like the content and hope it may be useful for someone.
PS: I’ll put in the middle on the text my impressions and opinion on the code, the problems I’ve encountered and why something don’t work and how to solve it.