You can render the context itself as a provider:
<ThemeContext value='dark'>React 19 lets you render the context itself as a provider: <ThemeContext value='dark'>.
"<ThemeContext.Provider> was removed" is the tempting wrong answer. It still works and is planned for deprecation later, so it does not throw. useContext only reads values, it never sets them. Providers can be nested anywhere, not only at the root, and the nearest one wins.