compose: Add types to useReducedMotion and useMediaQuery#31941
Merged
sarayourfriend merged 2 commits intotrunkfrom May 21, 2021
Merged
compose: Add types to useReducedMotion and useMediaQuery#31941sarayourfriend merged 2 commits intotrunkfrom
sarayourfriend merged 2 commits intotrunkfrom
Conversation
|
Size Change: +2 B (0%) Total Size: 1.62 MB
ℹ️ View Unchanged
|
tyxla
reviewed
May 19, 2021
| }, [ query ] ); | ||
|
|
||
| return query && match; | ||
| return !! query && match; |
Member
There was a problem hiding this comment.
This seems to be breaking some existing tests.
Contributor
Author
There was a problem hiding this comment.
Hmm, you're right. I wonder if we should update the test or keep the existing behavior and use a wider return type 🤔
Contributor
Author
There was a problem hiding this comment.
I've gone ahead and updated the test.
0025b64 to
34d910a
Compare
ciampo
reviewed
May 19, 2021
tyxla
approved these changes
May 19, 2021
Member
tyxla
left a comment
There was a problem hiding this comment.
Looks good to me 👍 I wonder if any of the failing tests could be related 🤔 I doubt they are TBH.
ntsekouras
approved these changes
May 20, 2021
3713b12 to
2d325f1
Compare
2d325f1 to
c2b9c53
Compare
c2b9c53 to
3372412
Compare
fullofcaffeine
added a commit
that referenced
this pull request
May 22, 2021
…-take-2 * trunk: (57 commits) Image block: fix cover transform and excessive re-rendering (#32102) compose: Add types to useMergeRefs (#31939) Navigation: Fix collapsing regression. (#32081) components: Promote Elevation (#31614) compose: Add types to useReducedMotion and useMediaQuery (#31941) Update the graphic that appears in the Template Editor welcome guide (#32055) Block Navigation: use CSS for indentation with known max indent instead of spacer divs (#32063) Fix broken template part converter modal styles. (#32097) compose: Add types to `usePrevious` (#31944) components: Add ZStack (#31613) components: Fix Shortcut polymorphism (#31555) compose: Add types to `useFocusReturn` (#31949) compose: Add types to `useDebounce` (#32015) List View: Simplify the BlockNavigation component (#31290) Remove query context leftovers (#32093) Remove filter_var from blocks (#32046) Templates: Remove now-obsolete gutenberg_get_template_paths() (#32066) [RNMobile] Enable reusable block only in WP.com sites (#31744) Rename ViewOwnProps to PolymorphicComponentProps (#32053) Rich text: remove inline display warning (#32013) ...
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.
Description
Adds types to
useMediaQueryanduseReducedMotion. Only one runtime change was necessary to cast the return type ofuseMediaQueryto a boolean.Also required adding a new variable to
gutenberg-envand adding the reference to it to thetypesproperty ofcompose'stsconfig.json.Part of #18838
How has this been tested?
Type checks pass and unit tests pass.
Types of changes
New feature.
Checklist:
*.native.jsfiles for terms that need renaming or removal).