Skip to content

#007 — React Fragment + WebRTC

Stream #007

Date: June 26, 2026 | 19:00 London / 21:00 Kyiv
Format: Two talks · ~60 min
Guest: Oleksandr Blazheiko
YouTube: https://youtube.com/live/leT3mUEmIqA

Participants

Oleh Levchenko — Senior Full Stack JavaScript Developer (React / Node.js / AWS)
The AA · Cardiff, UK
YouTube @zloyleva · itfriday.community

Oleksandr Blazheiko — Software Development Engineer · Fullstack, 7+ years of experience
Ukraine
LinkedIn · itvibe.party

Key Takeaways

Talk 1 — React Fragment · Oleh Levchenko

  • <></> compiles to React.Fragment — not just syntactic sugar, but a full component; adds no DOM node, which is critical for Flexbox/Grid layouts and valid HTML (e.g. <tr> inside <tbody>)
  • Shorthand vs explicit: <></> is convenient but accepts no props; for key in .map() always use <Fragment key={...}> — without it React can't track elements when order changes, and state becomes tied to position rather than identity
  • State preservation gotcha: <><Child /></> and <Child /> are the same React tree; but <><><Child /></></><Child /> are different — an extra Fragment level resets the child component's state
  • FragmentInstance (Canary): ref on <Fragment> returns not a DOM node but a FragmentInstance object — no DOM wrapper, yet with methods for three tasks
  • Events without wrapper: fragmentRef.current.addEventListener('click', handler) — one listener targeting all first-level DOM children; removeEventListener and dispatchEvent are also supported
  • Focus management: focus() finds the first focusable element depth-first; focusLast() — the last one; blur() removes focus if it's within the fragment — useful for accessibility when opening modals
  • observeUsing(observer): attaches an IntersectionObserver, ResizeObserver, or MutationObserver to all first-level DOM children in one call; unobserveUsing for cleanup — no wrapper div needed

Talk 2 — WebRTC · Oleksandr Blazheiko

  • WebRTC (Web Real-Time Communication) — open W3C/IETF standard since 2021: audio, video, and arbitrary data directly between browsers (peer-to-peer) without plugins or media relay servers
  • Two phases: first, peers "meet" through a Signaling server and STUN (SDP/ICE exchange + public address discovery), then media and data travel directly between devices — servers are no longer in the media path
  • ICE / STUN / TURN: ICE tries all possible network paths; STUN tells a device its public address; TURN is the fallback relay when direct P2P is impossible (Symmetric NAT)
  • When STUN is enough: Full Cone, Restricted Cone, Port-Restricted NAT — hole punching opens a direct channel; Symmetric NAT on both sides → TURN kicks in as a relay
  • Three core APIs: getUserMedia() — camera/microphone access; RTCPeerConnection — the heart of WebRTC: connection, NAT traversal, encryption; RTCDataChannel — bidirectional channel for text, files, game state
  • Signaling: WebRTC doesn't dictate the protocol — WebSocket, HTTP, SIP, or anything works; Peer A sends an offer (SDP), Peer B responds with an answer, then both exchange ICE candidates
  • Encryption is mandatory: DTLS — handshake directly in the P2P channel, verifies certificates and negotiates keys; SRTP encrypts every media packet using those keys; there is no unencrypted mode
  • Debugging in Chrome: chrome://webrtc-internals — live stats (bitrate, packet loss, jitter, RTT), ICE candidate state, full SDP offer/answer, export to file; getStats() API for custom monitoring
  • Challenges: P2P scales poorly to large groups → SFU architecture (media servers); TURN servers are costly under symmetric NAT; compatibility quirks between implementations

Timecodes

To be added after the stream.

Resources

IT Friday · @zloyleva