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.
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
Font Appearance Control: Refactor font appearance fallbacks #63215
Font Appearance Control: Refactor font appearance fallbacks #63215
Changes from 9 commits
68dc225
3b434b1
dacc850
23a8fa2
2e0e9c5
5a22028
9813347
23567d5
1f102c6
c74daeb
7e027b4
ef7350b
a796d13
72199cc
3796305
64b13cc
fc209a6
1f69824
a7a3b6a
74edc0c
cec7d9d
08e73d7
2e23bc5
b06c4e4
b407be1
9d7dfc4
18e1bfe
8288dd4
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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 are some missing dependencies, which results in a linter warning.
I think it'd be good to make sure that's fixed or the rule is disabled for this line (with a comment mentioning why).
To fix it, it looks like
setFontAppearance
andresetFontAppearance
would have to be wrapped inuseCallback
.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 tried adding all of the dependencies but it looks like this causes an infinite loop, and I think it's OK to rely on only the
fontFamily
changing here as this is the main prop we want to watch in this case.I've disabled the rule for this line with a comment explaining why: 3796305
I left the
useCallback
functions in forsetFontAppearance
andresetFontAppearance
as they seem to work the same either way, and I'm guessing this might have some small performance benefits.