React + TypeScript

React + TypeScript

In this episode of Syntax, Scott and Wes talk about using React with Typescript — how to set it up, components, state, props, passing data, custom hooks, and more! Freshbooks - Sponsor Get a 30 day free trial of Freshbooks at freshbooks.com/syntax and put SYNTAX in the “How did you hear about us?” section. Sentry - Sponsor If you want to know what’s happening with your code, track errors and monitor performance with Sentry. Sentry’s Application Monitoring platform helps developers see performance issues, fix errors faster, and optimize their code health. Cut your time on error resolution from hours to minutes. It works with any language and integrates with dozens of other services. Syntax listeners new to Sentry can get two months for free by visiting Sentry.io and using the coupon code TASTYTREAT during sign up. Linode - Sponsor Whether you’re working on a personal project or managing enterprise infrastructure, you deserve simple, affordable, and accessible cloud computing solutions that allow you to take your project to the next level. Simplify your cloud infrastructure with Linode’s Linux virtual machines and develop, deploy, and scale your modern applications faster and easier. Get started on Linode today with a $100 in free credit for listeners of Syntax. You can find all the details at linode.com/syntax. Linode has 11 global data centers and provides 24/7/365 human support with no tiers or hand-offs regardless of your plan size. In addition to shared and dedicated compute instances, you can use your $100 in credit on S3-compatible object storage, Managed Kubernetes, and more. Visit linode.com/syntax and click on the “Create Free Account” button to get started. Show Notes 04:55 - Components Strategies Example: type Props = { value: string; } const App = (props: Props) => Return type? JSX.Element FC or FunctionComponent It’s discouraged for this reason: It means that all components accept children, even if they're not supposed to It could be useful for a return type 12:13 - Props Default props: const defaultJoke: JokeProps = { joke: 'LOL JOE', id: 'YEAH', status: 200, }; function JokeItem({ joke = defaultJoke }: JokeProps): JSX.Element { return ( {joke.joke} = {joke.id} ); } Because props are always destructured, you often have to make a new type for your props. You can’t just type each argument by itself. 18:38 - State Just like Generics, State can be inferred If your type is simple and you’re using useState, it just works: const [user, setUser] = useState(null); 22:27 - useEffect Nothing special required Good use of void: If you want to use a Promise function but not worry about await or .then(), you can pop a void in front of it: useEffect(() => { console.log('Mounted'); // getJoke().then(console.log).catch(console.error); void getJoke(); }, [getJoke]); 26:09 - Refs Very similar to state however some interesting things with null: const ref1 = useRef(null!); “Instantiating the ref with a current value of null but lying to TypeScript that it’s not null.” 29:33 - Custom Hooks This is a great use case for Tuples 31:00 - Context This is probably the most complex thing in this list First define the types Use generic to pass in types OR null This can also be non-null if you have default values in createContext: const AppCtx = React.createContext(null); 35:21 - Events The React events system is better than Vanilla JS Can handle them inline and have it inferred: onClick={e ⇒ yeah(e.target)} const onSetType = (e: React.ChangeEvent) => setType(e.target.value) React has a bunch of events built in — many of them take a Generic argument so you can specify the type of element that triggered it. Handy for native API methods like play and pause. 39:27 - ForwardRef Again use of to pass in forwarded ref type as param 1, Props types as param 2: type Props = { children: React.ReactNode; type: "submit" | "button" }; export type Ref = HTMLButtonElement; export const FancyButton = React.forwardRef((props, ref) => ( {props.children} )); 41:30 - ESLint Typescript-react is good Extend your own Most JS rules apply to TS 46:20 - React as Global React 17 Also add JSX: True to eslint globals for typing things like JSX.Element global.d.ts import * as react from "react" import * as react_dom from "react-dom" declare global { type React = typeof react type ReactDOM = typeof react_dom } 48:08 - TSConfig jsx: "react" React emit .js files with JSX changed Preserve .jsx file output React-native → .js files with jsx not changed 53:05 - Frameworks? Next.js makes this a TREAT Gatsby just use .tsx extensions https://www.gatsbyjs.com/plugins/gatsby-plugin-ts-config/ Links https://github.com/typescript-cheatsheets/react Tanner Linsley https://github.com/wesbos/eslint-config-wesbos Deno Architect https://fav.farm/ Snowpack Vite Parcel 2 Foam ××× SIIIIICK ××× PIIIICKS ××× Scott: Obsidian Wes: Folding Allen Keys Shameless Plugs Scott: 1: Level Up Tutorials Pro Spring Sale - 50% off annual subscriptions! 2: SvelteKit Course Wes: Beginner Javascript Course - Use the coupon code ‘Syntax’ for $10 off! Tweet us your tasty treats! Scott’s Instagram LevelUpTutorials Instagram Wes’ Instagram Wes’ Twitter Wes’ Facebook Scott’s Twitter Make sure to include @SyntaxFM in your tweets

Jaksot(967)

943: Modern React with Ricky Hanlon (React Core Dev)

943: Modern React with Ricky Hanlon (React Core Dev)

Scott and Wes sit down with Ricky Hanlon from the React core team at Facebook to dive into the latest features and APIs shaping modern React development. From transitions and Suspense to fetching strategies and future directions, this episode breaks down what’s next for React and how developers can take advantage of it. Show Notes 00:00 Welcome to Syntax! 01:20 Who is Ricky Hanlon. 02:10 Setting the Stage: Modern React APIs 02:48 Brought to you by Sentry.io. 03:12 Defining Transitions in React 05:08 Practical Examples of Scheduling. 08:23 useDeferredValue. 09:30 Suspense. 11:13 Fallbacks and animations. 12:35 How do you get psychological performance data? 13:39 Are these considerations reasonable for the average dev? 15:37 useOptimistic. 17:35 Removing delayMs (referred to as maxDuration in later iterations). 19:49 How to fetch data in React. 21:58 Is React now just Nextjs? 23:23 Will React give us a Signals-based state management? 24:44 The challenges of building in public. 30:12 Making LLMs cooperate with React. 32:05 The lifting will happen at framework level. 32:59 This is not time slicing. 35:47 Sick Pick + Shameless Plug. Sick Picks Ricky: iPhone 17 Pro Shameless Plugs Ricky: https://conf.react.dev/ Hit us up on Socials! Syntax: X Instagram Tiktok LinkedIn Threads Wes: X Instagram Tiktok LinkedIn Threads Scott: X Instagram Tiktok LinkedIn Threads Randy: X Instagram YouTube Threads

6 Loka 202538min

942: Mental Health Q&A w/ Dr. Courtney Tolinski

942: Mental Health Q&A w/ Dr. Courtney Tolinski

Wes and Scott talk with Dr. Courtney Tolinski about supporting neurodivergent teammates, navigating workplace dynamics, and recognizing strengths beyond labels. They explore ADHD diagnosis and treatment, productivity mindsets, burnout, AI in mental health, and practical routines for focus and balance. Show Notes 00:00 Welcome to Syntax! 00:09 Meet Dr. Courtney Tolinski 01:46 Supporting neurodivergent team members 12:26 Should I disclose my ADHD diagnosis at work? 17:21 Characteristics of autism and ADHD 22:37 Seeking diagnosis as an adult developer 28:04 Brought to you by Sentry.io 32:18 Uncoupling identity from productivity 38:06 Is overtime ever “worth it”? 42:34 AI as a mental health tool: hope or hype? 46:32 Will therapists be replaced by AI? 49:29 Burnout warning signs in high-performers 55:15 Sick picks + shameless plugs Sick Picks Courtney: Bentgo Glass Containers Hit us up on Socials! Syntax: X Instagram Tiktok LinkedIn Threads Wes: X Instagram Tiktok LinkedIn Threads Scott: X Instagram Tiktok LinkedIn Threads Randy: X Instagram YouTube Threads

1 Loka 202557min

941: Is Responsible AI Possible? with Dr. Sarah Bird of Microsoft

941: Is Responsible AI Possible? with Dr. Sarah Bird of Microsoft

Scott heads to Microsoft’s campus for the VS Code Insider Summit to sit down with Dr. Sarah Bird and explore what “Responsible AI” really means for developers. From protecting user privacy to keeping humans in the loop, they dig into how everyday coders can play a role in shaping AI’s future. Show Notes 00:00 Welcome to Syntax! 01:27 Brought to you by Sentry.io. 03:13 The path the machine learning. 04:44 How do you get to ‘Responsible AI’? 06:43 Is there such a thing as ‘Responsible AI’? 07:34 Does the average developer have a part to play? 09:12 How can AI tools protect inexperienced users? 11:55 Let’s talk about user and company privacy. 13:57 Are local tools and services becoming more viable? 15:06 Are people right to be skeptical? 16:58 The software developer role is fundamentally changing. 17:43 Human in the loop. 19:37 The career path to Responsible AI. 21:21 Sick Picks. Sick Picks Sarah: Japanese pottery Hit us up on Socials! Syntax: X Instagram Tiktok LinkedIn Threads Wes: X Instagram Tiktok LinkedIn Threads Scott: X Instagram Tiktok LinkedIn Threads Randy: X Instagram YouTube Threads

29 Syys 202522min

940: Picking a Fullstack Stack, Is Next.js Too Complex? Services vs Self-Hosted + More

940: Picking a Fullstack Stack, Is Next.js Too Complex? Services vs Self-Hosted + More

In this potluck episode, Wes and Scott answer your questions about modern full-stack stacks, Node.js backend options, managing database indexes, developer burnout, handling toxic bosses, and more! Show Notes 00:00 Welcome to Syntax! 02:36 What’s your go-to Node.js backend in 2025? Polka 06:18 Do you proactively manage database indexes—or fix them only when they become a problem? 09:40 Brought to you by Sentry.io 12:14 After planning a new project, what’s your real-world dev workflow? 931: Project Init - How to Make Good Choices When Starting a New Coding Project 18:19 What to do when you’re feeling burned out as a developer 23:34 Picking the right tech stack for your partner’s website 28:18 How do you deal with a toxic boss? 33:10 The ideal tech stack for launching a SaaS MVP 39:46 Is GraphQL still worth it vs REST or RPC? 44:26 Is Vercel steering modern web dev in the wrong direction? 51:20 What’s up with TanStack Forms? TanStack Form Latest 59:35 Sick Picks + Shameless Plugs Sick Picks Scott: Flesh and Code Wes: WAGO connectors Shameless Plugs Syntax YouTube Channel Hit us up on Socials! Syntax: X Instagram Tiktok LinkedIn Threads Wes: X Instagram Tiktok LinkedIn Threads Scott: X Instagram Tiktok LinkedIn Threads Randy: X Instagram YouTube Threads

24 Syys 20251h 5min

939: Creator of Vite: Evan You

939: Creator of Vite: Evan You

Scott and Wes sit down with Evan You, creator of Vue, Vite, and VoidZero, to dig into the future of frontend tooling. From the speed of Rolldown to why he chose Rust, they explore the evolution of developer experience, bundlers, and what’s next for the web. Show Notes 00:00 Welcome to Syntax! 00:31 Who is Evan You? Vue.js. Vite. Void0 01:19 Making the shift from UI to Toolchains. 02:37 How aesthetics contributed to the success of Vue and Vite. 05:26 Adding Rollup plugins to the Dev Server. 07:31 Brought to you by Sentry.io. 07:56 Rollup and Rolldown explained. 09:29 NAPIRS. 10:02 Why Rust and not Go? SWC, OXC. 12:04 Rolldown’s speed and performance. OXC Allocator. 15:09 Dealing with massive buildtimes. 17:42 How has the transition been? 20:34 Why do we even need a bundler? 23:25 Vite’s superior developer experience. 26:01 Fullstack Vue? 31:45 Node and Vite’s relationship. 35:41 Wes’ wishlist. vite-dir. 37:28 Hot takes. 37:37 Would Next be better with Vite? 41:09 Thoughts on React Server Components. 43:40 Thought on Remix 3. 46:22 Tell us about Void0. 51:36 Sick Picks + Shameless Plugs. Sick Picks Evan: Laravel Lamborghini Shaped Stress Toys Shameless Plugs Evan: Viteconf, Vite, CultRepo. Hit us up on Socials! Syntax: X Instagram Tiktok LinkedIn Threads Wes: X Instagram Tiktok LinkedIn Threads Scott: X Instagram Tiktok LinkedIn Threads Randy: X Instagram YouTube Threads

22 Syys 202554min

938: Hot Takes + Bike Shedding

938: Hot Takes + Bike Shedding

Wes and Scott dive into some hot takes and classic debates—tabs vs spaces, camel vs snake case, export styles, barrel files, variable naming, and more. Show Notes 00:00 Welcome to Syntax! 01:26 CSS variables: descriptive vs. semantic 03:38 snake_case vs. camelCase 04:54 Default exports vs. named exports 06:23 Barrel files vs. direct imports 09:15 Function declaration vs. function expression 11:00 Inferred types vs. explicit types 13:40 Brought to you by Sentry.io 14:40 Long and explicit variable names vs. short with comments 16:27 Self-documenting code vs. code comments 17:03 Rebase vs. merge commit 18:39 Naming event parameters: e vs. event 20:33 Tabs vs. spaces 22:18 Big line height vs. small line height 23:50 Hard line length vs. line wrap Hit us up on Socials! Syntax: X Instagram Tiktok LinkedIn Threads Wes: X Instagram Tiktok LinkedIn Threads Scott: X Instagram Tiktok LinkedIn Threads Randy: X Instagram YouTube Threads

17 Syys 202527min

937: Is The Omarchy Hype Real?

937: Is The Omarchy Hype Real?

Scott takes Wes on a tour of Omarchy, DHH’s polished Arch + Hyprland Linux setup that promises speed, beauty, and endless keyboard shortcuts. From first impressions to daily workflows, Scott debates whether it’s good enough to pull him out of the Apple ecosystem for good. Show Notes 00:00 Welcome to Syntax! 02:31 Brought to you by Sentry.io. 02:55 What is Omarchy? 02:57 Arch-based distribution. 03:42 Hyprland window management. 05:08 Wayland Display Server Protocol. 06:27 Installation Defaults. 06:53 System-wide shortcuts. 09:01 My first impressions. 09:41 Connecting to my NAS. 10:54 Gigantic UI. 12:21 Day 2 Experiences. 13:22 Resizing window challenges. 16:11 Neovim and Lazyvim. 16:49 Lazygit. 19:07 How do you use it and why is it good. 19:14 Command Palette. 19:49 Raycast. Recreating Raycast. 20:50 Using the app launcher. 21:25 Screensavers. 21:59 OS Style. 22:55 My apps, my apps, my apps, check it out. 25:07 Is the hardware comparable to Mac’s M processors? 27:24 Installing new apps. 29:26 Web apps as first class citizens. 32:47 What I’ll miss. 35:56 What’s going on with MacOS UI? 38:37 Annoyances. 39:31 My advice. Read the Manual. 44:39 Sick Picks & Shameless Plugs. Sick Picks Scott: Omarchy Manual. Wes: Ugreen 200w Charger, Silicone USB C. Shameless Plugs Scott: Syntax on YouTube. Hit us up on Socials! Syntax: X Instagram Tiktok LinkedIn Threads Wes: X Instagram Tiktok LinkedIn Threads Scott: X Instagram Tiktok LinkedIn Threads Randy: X Instagram YouTube Threads

15 Syys 202548min

936: Realtime LED Wall With React + Websockets (I Let Strangers Control It)

936: Realtime LED Wall With React + Websockets (I Let Strangers Control It)

Scott, Wes, and CJ dive into Wes’s Hackweek project: a real-time, web-controlled LED grid. They break down the hardware build, custom 3D-printed diffuser, ESP32 microcontroller, and Cloudflare durable objects powering live pixel art, GitHub activity displays, and interactive web drawings. Show Notes 00:00 Welcome to Syntax! 02:03 Wes’ Hackweek project: a web-controlled LED grid 03:52 The hardware: LED panels, soldering, and power WS2812 LED panels 06:38 ESP32 microcontroller and WLED firmware explained ESP32 Microcontroller 10:57 Power supply challenges and injection fixes 15:05 Debugging and testing a DIY LED matrix 15:56 Shorts, blown circuits, and melted wires 17:58 Designing and 3D-printing the diffuser for crisp pixels 21:29 The software: Cloudflare Durable Objects + Party Server Cloudflare Durable Objects Party.server 22:18 Real-time sync and state management across clients Party Client 28:43 Connecting the server to the LED hardware 41:51 Open access fun: scripts, NSFW images, and moderation Cloudflare tunnel 44:10 Live demos 45:34 Future plans: stats, rooms, and making it always-on Hit us up on Socials! Syntax: X Instagram Tiktok LinkedIn Threads Wes: X Instagram Tiktok LinkedIn Threads Scott: X Instagram Tiktok LinkedIn Threads Randy: X Instagram YouTube Threads

10 Syys 202547min

Suosittua kategoriassa Politiikka ja uutiset

rss-ootsa-kuullut-tasta
aikalisa
ootsa-kuullut-tasta-2
tervo-halme
politiikan-puskaradio
rss-kuka-mina-olen
rss-vaalirankkurit-podcast
otetaan-yhdet
et-sa-noin-voi-sanoo-esittaa
aihe
rss-podme-livebox
rikosmyytit
radio-antro
rss-tasta-on-kyse-ivan-puopolo-verkkouutiset
the-ulkopolitist
rss-raha-talous-ja-politiikka
linda-maria
eevan-politiikkapodi-totuuksia-suomesta