Skip to content

Conversation

@MikhailZakharov-dev
Copy link
Contributor

@MikhailZakharov-dev MikhailZakharov-dev commented Jul 10, 2022

react doesn't apply style attributes with empty value (empty string) in
markup on server side and client side, but still make a strict comparison and try to find
background size and background image properties when hydrating client.
this is why someone might get these errors in their browser with react 18:

Warning: Prop style did not match. Server: "color:transparent; display:inline-block;height:244;width:244" Client: "background-image:; background-size:;color:transparent;display:inline-block; height:244;width:244" 

Fixes #105
removes unnecessary styles and error warning

react doesn't apply style attributes with empty value (empty string) in markup, but still make a strict comparison and try to find background size and background image properties when hydrating client. Warning: Prop style did not match. Server: "color:transparent; display:inline-block;height:244;width:244" Client: "background-image:; background-size:;color:transparent;display:inline-block; height:244;width:244"
Copy link
Owner

@Aljullu Aljullu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this contribution, @zakharovmikhail! Changes look good to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants