-
Notifications
You must be signed in to change notification settings - Fork 65
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
feat(deps): react@18 support #981
Conversation
|
||
unmount(); | ||
|
||
rerender( | ||
render( |
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.
Since I bumped @testing-library/react
, their unmount
method completely wipes container.innerhtml
so we just need to use render
instead. rerender
is really only useful for updates to props.
await userEvent.click(button); | ||
|
||
await userEvent.click(button); |
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.
Test was failing with act
so switched over to userEvent
.
renderHook(() => useUpdateItems(), { | ||
wrapper: class Wrapper extends Component<PropsWithChildren<unknown>> { | ||
override componentDidCatch(err: unknown) { | ||
error = err; | ||
} | ||
override render() { | ||
return this.props.children; | ||
} | ||
}, | ||
}); | ||
|
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.
When they ported over renderHook
to v13 of @testing-library/react
they shipped it with a leaner API. Now we don't get errors with this, but according to testing-library/react-testing-library#991 (comment) this is the best way to achieve the same thing.
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.
😵💫
<Small as="span" color="inherit"> | ||
Read more | ||
</Small> |
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.
Auto dismiss after 5 seconds. | ||
{/* I hate using a br but the as prop doesn't support div for now */} | ||
{/* TODO: Support div for as prop */} | ||
<br /> | ||
<Small as="span">Note: Only valid when used with AlertManager.</Small> |
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.
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.
:cringe:
Determines type of z-index to be applied. | ||
{/* I hate using a br but the as prop doesn't support div for now */} | ||
{/* TODO: Support div for as prop */} | ||
<br /> | ||
<Small as="span">Types are in order (sticky is low, popover is high).</Small> |
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.
f4f1be7
to
7493844
Compare
7493844
to
7d84ae3
Compare
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 working on this! 👍
@@ -61,7 +63,7 @@ function transformCode(input: string): string { | |||
} | |||
|
|||
export interface CodePreviewProps { | |||
children?: React.ReactNode; | |||
children?: CodePreviewChildren; |
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.
👏
renderHook(() => useUpdateItems(), { | ||
wrapper: class Wrapper extends Component<PropsWithChildren<unknown>> { | ||
override componentDidCatch(err: unknown) { | ||
error = err; | ||
} | ||
override render() { | ||
return this.props.children; | ||
} | ||
}, | ||
}); | ||
|
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.
😵💫
Auto dismiss after 5 seconds. | ||
{/* I hate using a br but the as prop doesn't support div for now */} | ||
{/* TODO: Support div for as prop */} | ||
<br /> | ||
<Small as="span">Note: Only valid when used with AlertManager.</Small> |
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.
:cringe:
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.
💭
7d84ae3
to
e0d38c4
Compare
Going to wait till #985 is released before releasing this PR. |
e0d38c4
to
1ca67a1
Compare
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.
🥳
What?
🎉 Finally... the time has come... React@18 support! 🎉
Why?
All the necessary libraries have finally been updated to support React@18.
Screenshots/Screen Recordings
Documentation site working as expected
Testing/Proof
Tested in channel-manager within the Control Panel.