mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
2807d781a0
Originally the intension was to have React assign an ID to a user rendered DOM node inside a `fallback` while it was loading. If there already were an explicit `id` defined on the DOM element we would reuse that one instead. That's why this was a DOM Config option and not just built in to Fizz. This became tricky since it can load late and so we'd have to transfer it down and detect it only once it finished rendering and if there is no DOM element it doesn't work anyway. So instead, what we do in practice is to always use a `<template>` tag with the ID. This has the downside of an extra useless node and shifting child CSS selectors. Maybe we'll get around to fixing this properly but it might not be worth it. This PR just gets rid of the SuspenseBoundaryID concept and instead we just use the same ID number as the root segment ID of the boundary to refer to the boundary to simplify the implementation. This also solves the problem that SuspenseBoundaryID isn't currently serializable (although that's easily fixable by itself if necessary).