-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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
[docs] Use stable context API #13477
Conversation
sourceCodeRootUrl: PropTypes.string.isRequired, | ||
}; | ||
|
||
export default EditPage; |
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.
"Fun" fact: If you don't export anything eslint will not warn you, the runtime will not throw because read of undefined. React will just throw with "expected component but got object".
Well done. I like you have extracted blocks of logic into render props, waiting for hooks to be available. |
1ab3859
to
3399f33
Compare
@@ -0,0 +1,5 @@ | |||
import React from 'react'; | |||
|
|||
const PageContext = React.createContext(); |
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.
That's missing the previous default values. They should be present for documentation purposes.
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.
Maybe a comment in this case?
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.
Documentation gets outdated. With actual values vscode is able to acquire type information and enables autocomplete.
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.
Documentation gets outdated.
Do does default values that are never used.
With actual values vscode is able to acquire type information and enables autocomplete.
Ok, that's the why. I'm adding them back.
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.
Thanks for raising.
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.
I believe that this is actual the typescript language server so any editor (plugin) that is leveraging that benefits. I just like my autocomplete ;)
e0996e5
to
b94be64
Compare
First step. Removes some noise when tracking down #13394