
Things I Explored in React Today (And Some JS That Finally Clicked)
Today was one of those sessions where small things started making actual sense. Here's what I explored. Arrow Functions Don't Eat Extra Memory I had this assumption that storing an arrow function in a new variable costs extra memory. Turns out the variable is just a reference — there's no duplicate logic sitting in memory. Small thing, but it was bugging me for a while. A Component Can Be Called Like a Regular Function You know you can write <Header /> in JSX — but {Header()} works too. The reason is simple: anything inside {} in React is just plain JavaScript, and a component is just a function. You won't use this style often, but knowing why it works makes JSX feel less magical. Use Parentheses When Wrapping JSX Output When your return spans multiple lines, wrap it in () not {}. Parentheses just group your output cleanly — curly braces mean something else in JS entirely. This one tiny habit saves a lot of weird silent bugs. Props — Two Different Moments There's defining and there's p
Continue reading on Dev.to React
Opens in a new tab



