How to create perfect Avatar Component | React | Beginners
HTML-код
- Опубликовано: 7 янв 2022
- If you think this is helpful to you, you can buy me a coffee:
www.buymeacoffee.com/imdebugger
Participate in the debugger community on the Discord server.
/ discord
Hi man, nice job, as someone wrote before, object-fit: cover might have been better for this case, however you made a nice working component and you have also explained nicely what you were doing on the way.
The only advice for the future that I would give is to keep the code clean. By that I mean for example to extract string values to consts, so you don't have to paste those long strings into the html code. It keeps the code more readable and you also don't have to repeat the links in onError.
Also, if you use the onError hook, you don't need the if-else statement in the return of Avatar.js - it'll work even if 'src' param is empty.
These are little things that keep the code looking neat and clean and also make you look more professional in front of other people - be it your co-workers or viewers.
Having said that, as I mentioned before the tutorial was really good and I hope to see more of your work in the future. Best of luck and keep it up!
I really appreciate your valuable suggestions which improve my coding quality thank you so much. I'll keep everything in my mind in future videos.
@@_debugger_ you're welcome, please keep up with your good work! :)
@@Boskimiszcz007 I'll pinned this comment up because it really deserve it.
Thanks!
Very useful
css image doesn't work and idk why
Participate in the debugger community on the Discord server.
discord.gg/BGkTfyxN
i think object-fit: cover is better in this situation
you saved me!!!! thanks
@@cintiaruizverdugo490 my pleasure
Bad audio
Thankyou, I will be take care of this next time.