Skip to content

Conversation

@sophiebits
Copy link
Collaborator

Is it OK to export ContextProvider = Context.Provider; from a use client file? If so, behold.

Is it OK to `export ContextProvider = Context.Provider;` from a `use client` file? If so, behold.
@sophiebits sophiebits requested review from acdlite and sebmarkbage May 8, 2023 06:47
@facebook-github-bot facebook-github-bot added CLA Signed React Core Team Opened by a member of the React Core Team labels May 8, 2023

if (providerPropTypes) {
checkPropTypes(providerPropTypes, newProps, 'prop', 'Context.Provider');
checkPropTypes(providerPropTypes, nextProps, 'prop', 'Context.Provider');
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Why do we always check these in the reconciler instead of in createElement?

typeof type === 'object' &&
(type.$$typeof === REACT_FORWARD_REF_TYPE ||
// Note: Memo only checks outer props here.
// Inner props are checked in the reconciler.
type.$$typeof === REACT_MEMO_TYPE)

Copy link
Member

Choose a reason for hiding this comment

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

IIRC, there was something subtle about either timing or default prop values? Only vaguely remember this from a comment by @sebmarkbage a while ago.

@react-sizebot
Copy link

Comparing: 559e83a...1fb16d0

Critical size changes

Includes critical production bundles, as well as any change greater than 2%:

Name +/- Base Current +/- gzip Base gzip Current gzip
oss-stable/react-dom/cjs/react-dom.production.min.js +0.10% 164.18 kB 164.35 kB +0.04% 51.78 kB 51.80 kB
oss-experimental/react-dom/cjs/react-dom.production.min.js +0.10% 171.57 kB 171.74 kB +0.07% 53.99 kB 54.03 kB
facebook-www/ReactDOM-prod.classic.js +0.07% 570.19 kB 570.59 kB = 100.62 kB 100.59 kB
facebook-www/ReactDOM-prod.modern.js +0.08% 553.93 kB 554.40 kB = 97.80 kB 97.78 kB

Significant size changes

Includes any change greater than 0.2%:

(No significant changes)

Generated by 🚫 dangerJS against 1fb16d0

@markspolakovs
Copy link
Contributor

If this gets merged #27168 can likely be closed.

@sophiebits
Copy link
Collaborator Author

#35675

@sophiebits sophiebits closed this Feb 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed React Core Team Opened by a member of the React Core Team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants