Loading tutorials
children, and use useState, useEffect and useRef. It also assumes you know what DOM nodes and document.body are, and how CSS positioning and z-index behave. By the end you should be able to say which of React's7 min readcreatePortal API: its signature, what it changes and what it leaves alone, and the mistakes that cause trouble in practice. It assumes you know function components, JSX, props and children, useState and useEffect, and basic DOM concepts such as nodes and `document.bod7 min readuseState and useEffect. It also assumes you know what createPortal(children, container) does and how document.body and CSS stacking work. Here you decide what the second argument should be, because that choice affects styling, testi7 min readcreatePortal. It assumes you know function components, props and children, useState, useEffect and useRef, DOM event bubbling, and basic CSS positioning and z-index. It also assumes you have seen createPortal(children, container) and why por6 min readuseState, useContext and createContext, and that you have used createPortal to move a modal to document.body. It builds on the previous chapter, where events bubbled through the React tree rather than the DOM tree. Context and state follow the same rule.6 min readcreatePortal. Both are small floating panels attached to a trigger element, and both have the clipping and stacking problems from the start of the tutorial. They add two new problems: positioning the panel next to its trigger, and dismissing it6 min readcreatePortal runs on the server, and how to make it safe. It assumes you can already build a portal-based modal, that you know useState and useEffect, and that you know the basic idea of server-side rendering (SSR). In SSR, React pro7 min readcreatePortal. It assumes you know React function components, useState and useEffect, and the basics of Jest or Vitest with React Testing Library. It also assumes you have read the earlier chapters on createPortal, portal containe6 min readcreatePortal, and that you know how React events bubble through the component tree. You should also be comfortable with useEffect cleanup. The chapter collects the mistakes that show up most often in real portal code and gives a fix fo7 min read