Skip to content
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

Warning: Text content did not match. Server: "33" Client: "30" #152

Closed
ghost opened this issue Sep 14, 2021 · 5 comments · Fixed by #159
Closed

Warning: Text content did not match. Server: "33" Client: "30" #152

ghost opened this issue Sep 14, 2021 · 5 comments · Fixed by #159

Comments

@ghost
Copy link

ghost commented Sep 14, 2021

Help-me, console error about countdown using Next.js

Console Error:
Screenshot_40

Client:
Screenshot_41

Code:
Screenshot_42

@ghost
Copy link
Author

ghost commented Sep 14, 2021

@ndresx

@ndresx
Copy link
Owner

ndresx commented Sep 25, 2021

Hi, does this help #101 (comment)?

@ghost
Copy link
Author

ghost commented Sep 26, 2021

Hi, does this help #101 (comment)?

It only works if I add in each item in the list.

<li suppressHydrationWarning>
	{zeroPad(days)} <span>Days</span>
</li>
<li suppressHydrationWarning>
	{zeroPad(hours)} <span>Hours</span>
</li>
<li suppressHydrationWarning>
	{zeroPad(minutes)} <span>Minutes</span>
</li>
<li suppressHydrationWarning>
	{zeroPad(seconds)} <span>Seconds</span>
</li>

Is there another way?

@ndresx
Copy link
Owner

ndresx commented Sep 30, 2021

Hmm, I don't think so, to be honest (I don't know). Maybe it works if you set autoplay to false and start it manually in the client.

@tumispro
Copy link

tumispro commented Jan 31, 2023

For what it's worth, what helped me was adding a 'isLoaded' state variable and then setting it to true in UseEffect(). Then show countdown based on that.

  const [ isLoaded, setIsLoaded] = useState(false)

  ...

  useEffect(() => {
    setIsLoaded(true)
  }, [])

  ...

  { isLoaded &&
    <Countdown .../>
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants