Closed
Description
Is there an existing issue for this?
- I have searched the existing issues and my issue is unique
- My issue appears in the command-line and not only in the text editor
Description Overview
In React 19, you can render <Context>
as a provider instead of <Context.Provider>
.
However when doing so jsx-no-constructed-context-values
doesn't detect violations.
const MyContext = createContext();
function MyComponent(props) {
return (<>
{/* old style - violation detected */ }
<MyContext.Provider value={{ hello: 'world' }} />
{/* react 19 style - no violation */ }
<MyContext value={{ hello: 'world' }} />
</>);
}
Expected Behavior
eslint-plugin-react version
v7.37.2
eslint version
v8.57.1
node version
v18.20.6