-
Notifications
You must be signed in to change notification settings - Fork 48k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow wrapping context provider in lazy #26792
base: main
Are you sure you want to change the base?
Conversation
Is it OK to `export ContextProvider = Context.Provider;` from a `use client` file? If so, behold.
@@ -3509,7 +3518,7 @@ function updateContextProvider( | |||
const providerPropTypes = workInProgress.type.propTypes; | |||
|
|||
if (providerPropTypes) { | |||
checkPropTypes(providerPropTypes, newProps, 'prop', 'Context.Provider'); | |||
checkPropTypes(providerPropTypes, nextProps, 'prop', 'Context.Provider'); |
There was a problem hiding this comment.
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?
react/packages/react/src/ReactElementValidator.js
Lines 224 to 228 in 16d053d
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) |
There was a problem hiding this comment.
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.
Comparing: 559e83a...1fb16d0 Critical size changesIncludes critical production bundles, as well as any change greater than 2%:
Significant size changesIncludes any change greater than 0.2%: (No significant changes) |
If this gets merged #27168 can likely be closed. |
Is it OK to
export ContextProvider = Context.Provider;
from ause client
file? If so, behold.