Uh oh!
There was an error while loading. Please reload this page.
[Suspense] Use style.setProperty to set display - #15882
Merged
Merged
Conversation
Follow up to react#15861. Turns out you can't set `!important` using a normal property assignment. You have to use `style.setProperty`. Maybe Andrew *should* just learn CSS. IE9 doesn't support `style.setProperty` so we'll fall back to setting `display: none` without `important`, like we did before react#15861 Our advice for apps that need to support IE9 will be to avoid using `!important`. Which seems like good advice in general, but IANACSSE. Tested on FB and using our Suspense DOM fixture.
sebmarkbage
approved these changes
Jun 14, 2019
| <AsyncText ms={500} text="B" /> | ||
| </div> | ||
| <div style={{display: 'block'}} ref={divs[2]}> | ||
| <div style={{display: 'span'}} ref={divs[2]}> |
CollaboratorAuthor
There was a problem hiding this comment.
I changed it to span since block is the default display for divs.
CollaboratorAuthor
There was a problem hiding this comment.
I was talking to my brain, not you.
Contributor
There was a problem hiding this comment.
This week's episode of "Andrew talks to himself" brought to you by the React team
Contributor
There was a problem hiding this comment.
But !important only accept from style.setProperty is really first time killer except holder of CSS degree😅
Thanks find out this @acdlite 😀
sizebot
commented
Jun 14, 2019
No significant bundle size changes to report. Generated by 🚫 dangerJS |
acdliteforce-pushed
the
use-style-setproperty
branch
from
June 14, 2019 01:13
52240a6 to
338eab2CompareContributor
@threepointone approved these changes 6 days ago 👀, so maybe it's not your fault Andrew(nice explanation!) |
rickhanlonii pushed a commit
to rickhanlonii/react
that referenced
this pull request
Jun 25, 2019
Follow up to react#15861. Turns out you can't set `!important` using a normal property assignment. You have to use `style.setProperty`. Maybe Andrew *should* just learn CSS. IE9 doesn't support `style.setProperty` so we'll fall back to setting `display: none` without `important`, like we did before react#15861 Our advice for apps that need to support IE9 will be to avoid using `!important`. Which seems like good advice in general, but IANACSSE. Tested on FB and using our Suspense DOM fixture.
Merged
This was referenced Aug 17, 2019
This was referenced Aug 24, 2019
This was referenced Mar 10, 2020
This was referenced Mar 18, 2020
mrizwanashiq pushed a commit
to mrizwanashiq/react
that referenced
this pull request
Jun 25, 2026
Follow up to react#15861. Turns out you can't set `!important` using a normal property assignment. You have to use `style.setProperty`. Maybe Andrew *should* just learn CSS. IE9 doesn't support `style.setProperty` so we'll fall back to setting `display: none` without `important`, like we did before react#15861 Our advice for apps that need to support IE9 will be to avoid using `!important`. Which seems like good advice in general, but IANACSSE. Tested on FB and using our Suspense DOM fixture.
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 freeto 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.
Follow up to #15861.
Turns out you can't set
!importantusing a normal property assignment. You have to usestyle.setProperty.Maybe Andrew should just learn CSS.
IE9 doesn't support
style.setPropertyso we'll fall back to settingdisplay: nonewithoutimportant, like we did before #15861. Our advice for apps that need to support IE9 will be to avoid using!important. Which seems like good advice in general, but IANACSSE.Tested on FB and using our Suspense DOM fixture.