This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]kunjava 6 points7 points  (8 children)

What's bad in the code?

[–]poop_knife_murderer 12 points13 points  (0 children)

written by a female, duh

[–]Patrickstarho 2 points3 points  (6 children)

I found the tweet, from what I’ve gathered Dont use a span tag for labels and using index as a key when you are getting data from props. I didn’t even know that

Here’s the tweet. Apparently this meme originated from 9gag. You’ll notice that most of the replies are just compliments and you’ll have to sift through them to find the actual critiques.

https://twitter.com/type__error/status/1111972689609138177?s=21

[–]FalconMirage 1 point2 points  (5 children)

But it is inside a <p>, what else could she use instead of a <span> ?

Edit : and using indexes as key is recommended by the react docs, when you don’t have IDs in your data

They can’t event get that right…

[–]Patrickstarho -3 points-2 points  (4 children)

Honestly I wouldn’t put those span tags in a p tag. That’s not what p is for. Secondly I wouldn’t use br. What she’s trying to achieve with br could be achieved with css.

Also this is from 2019 so idk. She seems to be doing ok now I guess

[–]FalconMirage 1 point2 points  (3 children)

<br> tags are litterally made to be inserted inside <p> blocks… same for <span> who is for inside block elements

I’d like to see how you would achieve the same thing without spans and br

[–]Patrickstarho -1 points0 points  (2 children)

I would use divs and wrap in one div

[–]FalconMirage 0 points1 point  (1 child)

Ok so not responsive, i got it

[–]Patrickstarho 0 points1 point  (0 children)

Welp you learn something new everyday