You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Your project is looking soup-er 🍜 compliment sandwich incoming below... 🥪
1. Great job structuring your code
You've clearly thought about how to write reusable code (i.e. by exporting the calculate function from your global /utils directory, and making that InputBox component) that is also easy to read. Mission accomplished methinks!
2. You can make your code more readable by using const instead of let.
Declare constant variables with const to indicate to someone reading your code for the first time that the variable's assigned value doesn't change. This can make your code even more readable and is a good habit to get into.
An example of where you might want to change a let to a const is on line 14 of src/utils/calculate.js
3. Case sensitive endpoints are confusing
Is it intentional that /myProfile takes you to the profile page, but /myprofile doesn’t? I would suggest making your app’s endpoints case insensitive because domain names are treated as case insensitive (WWW.GOOGLE.COM === www.google.com), and it would be strange if only the slug (the portion after the ‘/‘) was case sensitive.
4. Your routing logic is 👌🏼👌🏼👌🏼
I know you talked about using react-router previously, and if this is something that you would still like to learn then by all means try it out next week! But personally, I think the custom routing logic you’ve written for navigating between pages in App.js is nice and readable as it is. react-router just abstracts detail, but is functionally similar to what you’ve already got working.
So on the one hand, don't be afraid to tackle react-router next week if that appeals, but on the other hand, if it ain't broke, don't fix it! 😎
The text was updated successfully, but these errors were encountered:
Your project is looking soup-er 🍜 compliment sandwich incoming below... 🥪
1. Great job structuring your code
You've clearly thought about how to write reusable code (i.e. by exporting the calculate function from your global /utils directory, and making that InputBox component) that is also easy to read. Mission accomplished methinks!
2. You can make your code more readable by using const instead of let.
Declare constant variables with const to indicate to someone reading your code for the first time that the variable's assigned value doesn't change. This can make your code even more readable and is a good habit to get into.
An example of where you might want to change a let to a const is on line 14 of
src/utils/calculate.js
3. Case sensitive endpoints are confusing
Is it intentional that
/myProfile
takes you to the profile page, but/myprofile
doesn’t? I would suggest making your app’s endpoints case insensitive because domain names are treated as case insensitive (WWW.GOOGLE.COM === www.google.com), and it would be strange if only the slug (the portion after the ‘/‘) was case sensitive.4. Your routing logic is 👌🏼👌🏼👌🏼
I know you talked about using react-router previously, and if this is something that you would still like to learn then by all means try it out next week! But personally, I think the custom routing logic you’ve written for navigating between pages in App.js is nice and readable as it is. react-router just abstracts detail, but is functionally similar to what you’ve already got working.
So on the one hand, don't be afraid to tackle react-router next week if that appeals, but on the other hand, if it ain't broke, don't fix it! 😎
The text was updated successfully, but these errors were encountered: