~/talk

A Subtle Introduction to Portals In React

Talkat JSCAMP Virtual 2021 · 2021-07-15..07-16· [react, accessibility]
slides:none on file

Portals render children into a DOM node outside the parent while preserving React context, event bubbling and state, introduced in React 16 and implemented with react-dom.createPortal. Practical builds include modals and select menus where a portal keeps focus trapped in the widget and lets other parts remain interactive, unlike a native select that blocks interaction until closed. Demo code shows createPortal targeting document.body and the approach reliably fixes overflow/stacking-context clipping.

AI-written summary · about

  1. 0:00A Subtle Introduction to React Portal
  2. 2:58What is React Portal?
  3. 6:28an example of a React Portal?
  4. 7:53Benefits of React portal to developers
  5. 9:36Improving accessibility in custom widgets with React portal
  6. 15:01Things to Note When Using React
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.