This is my first major attempt at React. I'll appreciate tips on how to improve my code. Thanks in advance.
Solomon Ekrebe
@krebeDevAll comments
- @krebeDevSubmitted almost 5 years ago@krebeDevPosted almost 5 years ago
I appreciate your feedback @mattstuddert.
As a beginner, working with React was quite tough, but exciting nonetheless.
- I didn't know assigning
e.currentTarget.id
touserChoice.name
will directly mutate theuserChoice
object instate
, because I started off by cloninguserChoice
andhouseChoice
like so:
handlePick = (e) => { const userChoice = {...this.state.userChoice}; const houseChoice = {...this.state.houseChoice}; // Other code lines go here }
Do I have to clone/setState for each key : value pair in this instance?
I've started learning about hooks, and definitely will apply them once I get the hang of it.
- On the identical components, I'll refactor my code as you suggested. I just noticed the same repetitive pattern in my
Starter
component too. I'll fix them.
0 - I didn't know assigning
- @krebeDevSubmitted almost 5 years ago
I've had to use two empty
div
s to display the curly background patterns in the intro section. I feel this approach is not effective. Any ideas on a better way to achieve the design that's in line with best design practices? You're welcome.@krebeDevPosted almost 5 years agoThanks for the feedback @mattstuddert. I didn't know I could use
url()
ascontent
for::before
and::after
pseudo-elements until today. I'll definitely give it a try.0 - @confusedDipSubmitted almost 5 years ago
Please share your feedback!
@krebeDevPosted almost 5 years agoThe design is great on desktop/large screens. I suggest you include media queries by introducing different breakpoints/CSS rules to make it responsive in smaller viewports.
1 - @EvonuXSubmitted almost 5 years ago
Been a while since I've made anything in React, also my first project using hooks! Let me know how if you like it and if I missed something :)
@krebeDevPosted almost 5 years agoI see nothing missing :). Great job you've done here!
1 - @faheem102Submitted almost 5 years ago
hej this is my solution as a beginner. i do not know how to fill logo color into white. can some one please explain to me with some easy method to it. thank you
@krebeDevPosted almost 5 years agoHey @faheem102,
Great work on this challenge. To change the logo colour, one way is to load it directly as
svg
element instead of usingimg
tag. Then change the fill color of thesvg
to white inside thesvg
style definition.1 - @vongphakdySubmitted almost 5 years ago
I have 2 error cases for email validation; the first is an empty field, second is an invalid email address. Both cases should activate the error message and icon, however only this only applies to the first case. When entering an invalid input, the form reveals a prompt rather than my coded error message/icon. I'm new to JS so I appreciate any input
@krebeDevPosted almost 5 years agoHello @vongphakdy, Great job on this challenge. Your error message is not being activated because HTML5
form
comes with built-in form validation. To deactivate this default behaviour and ensure your JavaScript code is triggered, add anovalidate
attribute on the form element. In your case, your code will be like so<form novalidate class="main-form">
.Also, your JS form validation code should be enhanced to accommodate other use cases. For example, if a user enters a correct email after a wrong attempt, the error message should be discarded.
2 - @DanielGibsonOrchidSubmitted almost 5 years ago
Feedback is always appreciated! Had great fun making this app, especially going back to basics with vanilla JS.
@krebeDevPosted almost 5 years agoWow!!! Great work Daniel. I personally have been battling with this challenge for some days now. Your code is clean and comprehensible. I have no improvements to recommend. Great job.
1 - @Moha-99Submitted almost 5 years ago
Your feedback is very very important to me and it's appreciated, Thanks for stopping by.
@krebeDevPosted almost 5 years agoI checked in. My observations are the same issues being addressed by @Mattstuddert, particularly the breakpoints. You can improve in those areas.
1 - @chadrackSubmitted almost 5 years ago
Hi! I'm new at coding if you have any feedback to help me improve. thank you for your time.
@krebeDevPosted almost 5 years agoI also noticed the link to your live site is broken.
0 - @chadrackSubmitted almost 5 years ago
Hi! I'm new at coding if you have any feedback to help me improve. thank you for your time.
@krebeDevPosted almost 5 years agoHi Chadrack, great work! Do check your page's Report and fix the accessibility and validation issues. I can help if you need more clarifications on these.
1 - @matejkubicekSubmitted almost 5 years ago
I'm newbie in front-end development and I know, that my workflow is little bit complicated for this small project, but I trying to learn frontend technologies and tools more comprehensively.
Please leave me a feedback about my code and used workflow. Thx
@krebeDevPosted almost 5 years agoLooks good. But do check the HTML validation report on your solution. The
roles
you specified in your markup are unnecessary since you already used the appropriate HTML5 semantic elements.1