feat(deps): react@18 support#981
Merged
chanceaclark merged 1 commit intobigcommerce:masterfrom Sep 27, 2022
chanceaclark:feat/react-18
Merged
feat(deps): react@18 support#981chanceaclark merged 1 commit intobigcommerce:masterfrom chanceaclark:feat/react-18
chanceaclark merged 1 commit intobigcommerce:masterfrom
chanceaclark:feat/react-18
Conversation
chanceaclark
commented
Sep 20, 2022
| unmount(); | ||
|
|
||
| rerender( | ||
| render( |
Contributor
Author
There was a problem hiding this comment.
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.
Comment on lines
+550
to
+552
| await userEvent.click(button); | ||
|
|
||
| await userEvent.click(button); |
Contributor
Author
There was a problem hiding this comment.
Test was failing with act so switched over to userEvent.
Comment on lines
+15
to
25
| renderHook(() => useUpdateItems(), { | ||
| wrapper: class Wrapper extends Component<PropsWithChildren<unknown>> { | ||
| override componentDidCatch(err: unknown) { | ||
| error = err; | ||
| } | ||
| override render() { | ||
| return this.props.children; | ||
| } | ||
| }, | ||
| }); | ||
|
|
Contributor
Author
There was a problem hiding this comment.
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.
Comment on lines
+61
to
+63
| <Small as="span" color="inherit"> | ||
| Read more | ||
| </Small> |
Comment on lines
+21
to
+25
| 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> |
Comment on lines
+67
to
+71
| 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> |
jorgemoya
approved these changes
Sep 20, 2022
Contributor
jorgemoya
left a comment
There was a problem hiding this comment.
Thanks for working on this! 👍
|
|
||
| export interface CodePreviewProps { | ||
| children?: React.ReactNode; | ||
| children?: CodePreviewChildren; |
Comment on lines
+15
to
25
| renderHook(() => useUpdateItems(), { | ||
| wrapper: class Wrapper extends Component<PropsWithChildren<unknown>> { | ||
| override componentDidCatch(err: unknown) { | ||
| error = err; | ||
| } | ||
| override render() { | ||
| return this.props.children; | ||
| } | ||
| }, | ||
| }); | ||
|
|
Comment on lines
+21
to
+25
| 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> |
Contributor
Author
|
Going to wait till #985 is released before releasing this PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



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.