#(SOLVED) Prop `style` did not match. Server null Client display

6 messages · Page 1 of 1 (latest)

solemn pewter
#

Hey! I'm trying to make 2 different div's show depending on the state of showOverlayLeft/showOverlayRight. However, when any of the states are "true", I get the error "Prop 'style' did not match. Server: "null" Client: "display:"".

tame raft
#

Hello, I've never used inline styling, what do you think of using "showOverlayLeft/showOverlayRight" states to add/remove css class instead of change the inline style value ?

solemn pewter
#

Might work but it seems odd that a simple value change will mess things up. I just got the idea of trying && and || instead. Will give that a try

#

Didn't work 🙃

#

This might be one of the most stupid solutions ever but I fixed it simply by changing the condition fallback to " " (with a space) instead of ""

#

Final code if anyone else is seeking a solution.