React · Senior · Question 56 of 75

When is suppressHydrationWarning appropriate?

<time suppressHydrationWarning>{new Date().toLocaleTimeString()}</time>

Explanation

It doesn't fix the mismatch; React keeps the server text. For content that must differ on the client, render it after mount (effect) or move it to client-only rendering.

Further reading

Problem with a question

React · Senior · question 56

Test yourself

Take the React · Senior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz