What are some terms you found confusing when learning web development and/or React? No judgement, please send me some!
-
Show this thread
-
Replying to @dan_abramov
"expression" I still don't know how to explain it well, though I know what it is.
21 replies 1 retweet 108 likes -
Replying to @ryanflorence @dan_abramov
FWIW, I never use the term expression, nor do I think about code that way. Benefit of being self taught by doing. I didn’t know I was “supposed to” know jargon. I didn’t even learn the difference between arguments and parameters until last year, and I already forgot it. Useless.
1 reply 0 retweets 5 likes -
Replying to @stevensacks @dan_abramov
When you're giving a workshop people ask: "what can go inside the {} in JSX?" The answer is: "any expression". A good explanation of a piece of jargon is worth a lot of time learning by doing on your own!
1 reply 0 retweets 3 likes -
Replying to @ryanflorence @dan_abramov
I just think “code goes inside of braces in JSX”. Technically speaking, I’m correct. However, you _should_ limit said code to “expressions”, as it were. I’ve conceptually internalized what they are without necessarily internalizing the dictionary definition.
2 replies 0 retweets 1 like -
You can’t put just any code there. Only a single expression. Try e.g. <MyComponent someProp={ var foo = 4 }>
1 reply 0 retweets 0 likes -
You can put multiple lines of code, declare variables, even write a for loop. Doesn’t have to return anything. I saw it in a Jr Dev’s code the other day. It technically worked. Maybe using a single var declaration doesn’t.
3 replies 0 retweets 0 likes -
If it worked then it was inside a function literal. e.g.: () => { var foo = 4 } A function literal is also an expression, though the code inside it, “unwrapped”, isn’t. Also, if it doesn’t return anything there’s no use putting it in the JSX :)
1 reply 0 retweets 0 likes
This applies both to props and braces inside of tags
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
