Skip to content

Commit

Permalink
update message
Browse files Browse the repository at this point in the history
  • Loading branch information
Shailendra Gupta committed Jun 4, 2020
1 parent f1ec9b7 commit 8c85dc0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion packages/react-reconciler/src/ReactFiberBeginWork.new.js
Original file line number Diff line number Diff line change
Expand Up @@ -2814,7 +2814,9 @@ function updateContextProvider(
if (!('value' in newProps)) {
if (!hasWarnedAboutUsingNoValuePropOnContextProvider) {
hasWarnedAboutUsingNoValuePropOnContextProvider = true;
console.error('<Context.Provider> must have a value prop');
console.error(
'The prop `value` is required in `Context.Provider`, have you misspelled it',
);
}
}
const providerPropTypes = workInProgress.type.propTypes;
Expand Down
4 changes: 3 additions & 1 deletion packages/react-reconciler/src/ReactFiberBeginWork.old.js
Original file line number Diff line number Diff line change
Expand Up @@ -2811,7 +2811,9 @@ function updateContextProvider(
if (!('value' in newProps)) {
if (!hasWarnedAboutUsingNoValuePropOnContextProvider) {
hasWarnedAboutUsingNoValuePropOnContextProvider = true;
console.error('<Context.Provider> must have a value prop');
console.error(
'The prop `value` is required in `Context.Provider`, have you misspelled it',
);
}
}
const providerPropTypes = workInProgress.type.propTypes;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1097,7 +1097,7 @@ describe('ReactNewContext', () => {
);

expect(() => expect(Scheduler).toFlushWithoutYielding()).toErrorDev(
'<Context.Provider> must have a value prop',
'The prop `value` is required in `Context.Provider`, have you misspelled it',
{
withoutStack: true,
},
Expand Down

0 comments on commit 8c85dc0

Please sign in to comment.