Repository navigation
Update All The Reacts - #2124
Conversation
|
You could declare a global |
@j-f1 while it was a methodical refactoring to get here, the net outcome was basically a find-replace. I don't think introducing a type and then including it everywhere will improve this. |
|
|
||
| /** An array of additional buttons to render after the "Sign In" button. */ | ||
| readonly additionalButtons?: ReadonlyArray<JSX.Element> | ||
| readonly additionalButtons?: ReadonlyArray<JSX.Element> | number | string | boolean| {} | null |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
|
||
| /** The title of the button. */ | ||
| readonly children?: string | ||
| readonly children?: ReadonlyArray<JSX.Element> | number | string | boolean| {} | null |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
|
||
| /** An array of additional buttons to render after the "Continue" button. */ | ||
| readonly additionalButtons?: ReadonlyArray<JSX.Element> | ||
| readonly additionalButtons?: ReadonlyArray<JSX.Element> | number | string | boolean| {} | null |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
|
||
| /** The title of the button. */ | ||
| readonly children?: string | ||
| readonly children?: ReadonlyArray<JSX.Element> | number | string | boolean| {} | null |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
|
||
| /** An array of additional buttons to render after the "Sign In" button. */ | ||
| readonly additionalButtons?: ReadonlyArray<JSX.Element> | ||
| readonly additionalButtons?: ReadonlyArray<JSX.Element> | number | string | boolean| {} | null |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| } | ||
|
|
||
| public componentDidUpdate = () => { | ||
| public componentDidUpdate() { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| readonly saveLabel?: string | ||
|
|
||
| /** Additional elements that are rendered below the form. */ | ||
| readonly children?: ReadonlyArray<JSX.Element> |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| /** | ||
| * An Errors element with app-standard styles. | ||
| * | ||
| * Provide `children` elements to render as the content for the error element. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| interface IDialogFooterProps { | ||
| readonly children?: ReadonlyArray<JSX.Element> | ||
| } | ||
| interface IDialogFooterProps { } |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
|
||
| /** An array of additional buttons to render after the "Sign In" button. */ | ||
| readonly additionalButtons?: ReadonlyArray<JSX.Element> | ||
| readonly additionalButtons?: ReadonlyArray<JSX.Element> | number | string | boolean | {} | null |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
🍎 |
It's been a while since we bumped the
react*packages, and there's been a bunch of changes to the related@types/react*packages. So let's do that.This uncovered a bunch of changes to how the type declarations now work, and while I did love our use of
voidfor the state type inReact.Component<TProps, TState>, this confuses TypeScript assetStateexpects a type - even in cases when a component doesn't use it. So an empty{}isn't the exact same thing, but any accidentalsetStateusages should fail.The other thing that's changed is the
childrenprop on components - React now declares this by default:I didn't feel great about removing the places where
childrenwas already defined, because it is no longer clear which components will renderchildrenelements. The alternative, making it explicit everywhere and aligning it with the declaration that React provides, also didn't feel great. I'll ponder on this some more before marking this as ready for review.I'll also do a bunch of real testing to ensure nothing is now broken.
One upside: it did pick up that we had incorrectly declared an instance property for
componentDidUpdateindropdown.tsx, rather than declaring it as an instance member.EDIT: and the signature for
list.tsx'srefcallback needs to take inReact.Component<any, any> | null(it previously didn't).