Syntax - Tasty Web Development Treats
Syntax - Tasty Web Development Treats

Syntax Live React Edition

It’s another live episode of Syntax in which Wes and Scott do Hook’d on Hooks, Who’s Snackin’ on React, Stump’d, Unpopular Opinions, Q & Eh, and more! Sentry - Sponsor If you want to know what’s happening with your errors, track them with Sentry. Sentry is open-source error tracking that helps d

Featured Speakers

Wes Bos & Scott Tolinski - Full Stack JavaScript Web Developers HostScott Tolinski Guest

Topics Discussed

Episode Summary

Executive Summary: In this live Syntax episode, Scott Tolinski and Wes Bos mix audience games, practical React Hooks examples, live coding, interview questions, and a discussion of React hot takes. They demonstrate hooks for storage, sockets, events, and element measurement; reflect on when React patterns add needless complexity; and answer audience questions about learning, debugging, and their early projects.

Main Topics: Audience games and live-show format: The hosts introduce their weekly short Monday Hasty Treats and longer Wednesday episodes, then use audience polling for a quiz about which company websites use React and a second quiz matching technical terms to their meanings. Practical React Hooks: They walk through examples for persisting values in local storage, capturing WebSocket data, detecting clicks outside an element, tracking key presses, and measuring elements with Resize Observer. They emphasize effect cleanup and note Intersection Observer can support visibility hooks. Collaborative live coding: The hosts alternate every 30 seconds while building a dad-joke fetcher with Create React App and hooks. The exercise is chaotic but eventually works, prompting discussion of whether a custom hook was necessary for a one-off component. React interview concepts: Audience members answer questions about PureComponent and shallow comparison, setState callbacks, reversing arrays without mutation, useReducer, useLayoutEffect, and PropTypes shapes. React opinions and complexity: The hosts consider claims that React should become part of the browser, hooks can be harder for beginners, React apps are often overcomplicated, and Context plus useReducer may suffice for some projects. They also discuss learning curves, data loading, and suspense. Audience Q&A and lessons from experience: The hosts recount early applications, difficult React problems, costly mistakes, hacky implementations, and how they began coding. They discuss JavaScript classes as a matter of preference and advise learning tools as needed rather than trying to predict the future.

Key Arguments: Hooks can make common browser and application behaviors reusable with relatively little code; examples include local storage, event listeners, keyboard state, socket data, and element measurement. Effects that install listeners should clean them up, and code that needs to run in response to a state change can use an effect rather than a setState callback. React solutions should match the actual problem: Context and useReducer can cover some shared-state needs, while Redux or elaborate abstractions are not automatically necessary. Hooks are useful but data fetching remains awkward in some cases; the hosts point to Suspense for data loading as a feature that could simplify that work. Developers often understand immutable updates more deeply after experiencing bugs caused by mutating shared state, rather than through explanation alone. JavaScript classes are optional: developers can use them if they prefer, but the hosts do not consider them mandatory.

Data Points: Hasty Treat target length: 15 minutes, sometimes 45 minutes - The hosts describe their Monday short-form episodes as intended to be brief but occasionally longer. Tasty Treat episode length: About one hour - Their Wednesday episodes are described as longer, in-depth discussions. Live React website quiz participation: About 130 participants - The hosts noted the audience size during the first Pigeonhole poll game. Wayfair poll result: 73.6% correct - The hosts said that share correctly identified Wayfair.com as the React-powered site in its matchup. Class usage poll: About 9,000 responses; exactly 50-50 - Wes described a Twitter poll asking whether respondents use JavaScript classes. Audience use of Hooks: About half - In a show-of-hands question, roughly half the audience said they were already using Hooks in production.

Pivotal Quotes: "Most people make React apps more complicated than they need to be." — Sophie Alpert (quoted in the hosts' discussion): The hosts agree with this opinion and point to excessive abstractions and premature hook creation as examples. "If you don't want to, just don't use them. If you do want to use them, keep going with it." — Wes Bos: His pragmatic response to the debate over whether developers should use JavaScript classes. "You can read as much as you want about these topics, but it's only until you get bit by, like, 'Oh, that's why everyone's talking about this.'" — Scott Tolinski: He describes learning the importance of immutable state updates after encountering problems caused by mutation.

Implications: Listeners can use Hooks to encapsulate everyday browser behavior, but should avoid abstractions that do not serve a real reuse or complexity need. React skills grow through practical problem-solving, and developers can choose patterns—such as classes, Context, or reducers—that fit their project.

🔓 Sign Up for Unlimited Episode Search

About Syntax - Tasty Web Development Treats

View all episodes from Syntax - Tasty Web Development Treats