@react-spectrum/toastimports are not automatically migrated. Move them to S2, then re-checkToastContainermounts andToastQueueusages.- v3
ProvideranddefaultThemewrappers in apps and tests need human review. S2 does not use the v3 theme object model.
- Collapse v3 component imports onto
@react-spectrum/s2. - Keep using
@spectrum-icons/*only when there is no S2 icon or illustration equivalent. Prefer@react-spectrum/s2/icons/*and@react-spectrum/s2/illustrationswhen possible. - If the codemod leaves
TODO(S2-upgrade)next to an icon or illustration import, pick the nearest S2 replacement manually.
- Full-page apps usually add
import '@react-spectrum/s2/page.css';at the entrypoint and no longer need a mandatory root Provider just to supplytheme={defaultTheme}. - Embedded sections still use S2
Providerwith an explicitbackground. - Keep or add S2
Provideronly when locale, router integration, color-scheme/background overrides, or SSRelementType="html"behavior are needed. - Preserve unrelated wrappers such as routing, store, analytics, i18n, and host-framework providers. Replace or remove only the React Spectrum-specific layer.
- Convert v3 style props and
UNSAFE_stylecases to the S2 style macro when possible. FlexandGridoften becomedivelements styled with the macro.- Review
ClearSlotsand other direct@react-spectrum/utilsimports manually. These are not part of the common S2 app surface.
DialogContaineranduseDialogContainerstill exist in S2, but the import path changes and dismiss logic may need to move betweenDialog,DialogTrigger, andDialogContainer.- When
Itemsurvives the codemod, rename it based on its parent:MenuItem,PickerItem,ComboBoxItem,ListBoxItem,Tab,TabPanel,Tag,Breadcrumb, and similar. - Preserve React
keywhen mapping arrays, but ensure collection data items exposeidwhen S2 expects it. - Table and ListView migrations often need manual review for row headers, nested columns, and explicit item ids.
- Replace v3 Provider/defaultTheme test wrappers with the minimal S2
Providerprops the test actually needs, or remove the wrapper entirely if no S2 context is required. - Update toast mocks and assertions that still reference
@react-spectrum/toastor old dialog markup.