this post was submitted on 21 Aug 2023
1057 points (98.2% liked)

Programmer Humor

19154 readers
2012 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 1 year ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 17 points 1 year ago (6 children)

Probably the hardest part of React, for me, was getting used to the callbacks. Passing data up to the parent component using a function. It's a little difficult to get used to if you haven't encountered it already

[–] [email protected] 1 points 1 year ago (3 children)

You can pass data to top components from the child ones using the useContext. Use it only if you have data where you want to pass data from multiple child components to the parent one, if you just want to use from one component you are good with states.

[–] [email protected] 5 points 1 year ago* (last edited 1 year ago) (1 children)

I think you're being down voted because context should be used sparingly. You can pass data back up the parent chain through prop functions.

[–] [email protected] 1 points 1 year ago

Yes I’m aware, was just giving a suggestion. I even linked to its documentation where all that information is available.

To be fair couldn’t care less if Im voted down or not, if I could I’d have an option to just hide that vote bullshit it’s just visual garbage in the UI. Basically a remnant from centralised social networks from the web2 era.

load more comments (1 replies)
load more comments (3 replies)