Skip to content

Conversation

karthik-awebon
Copy link
Contributor

@karthik-awebon karthik-awebon commented Feb 27, 2025

https://react.dev/blog/2024/12/05/react-19#context-as-a-provider

As per this blog post, In React 19 you can render <Context> as a provider instead of <Context.Provider> and <Context.Provider> soon will be deprecated in future versions. So it is better to update the code on the page https://react.dev/learn/passing-data-deeply-with-context
@gaearon Please review this PR. Thanks

Copy link

vercel bot commented Feb 27, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
19-react-dev ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 27, 2025 8:30am
react-dev ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 27, 2025 8:30am

Copy link

Size changes

📦 Next.js Bundle Analysis for react-dev

This analysis was generated by the Next.js Bundle Analysis action. 🤖

This PR introduced no changes to the JavaScript bundle! 🙌

Copy link
Member

@gaearon gaearon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@gaearon gaearon merged commit cc774fa into reactjs:main Feb 27, 2025
10 checks passed
@locofocos
Copy link

I was reading this section on https://react.dev/learn/passing-data-deeply-with-context and I thought the docs were broken somehow. It was confusing, because the text says "Wrap them with a context provider" yet the code snippet doesn't show a provider.

Do you think it makes sense to reword the text somehow? Like

Wrap them with a context provider to provide the LevelContext ...

Or would it be valuable to show both the old and new syntax, since it will be deprecated in "future versions"?

@karthik-awebon
Copy link
Contributor Author

@locofocos The text 'context provider' looks good to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants