React Native Hydration Error: Expected server HTML to contain a matching <div>

60 Views Asked by At

I'm encountering an issue in my React Native project where I'm getting the following error during hydration: Expected server HTML to contain a matching <div>

The error stack trace points to components like View, KeyboardAvoidingView, ThemeProvider2, SafeAreaProvider, and others. I'm using Storybook for React Native, and it seems like there's a problem with the initial HTML on the server not matching what's rendered on the client during hydration.

I've checked my Storybook configuration, examined the involved components, and tried using React.StrictMode, but the issue persists. I suspect it might be related to the compatibility of versions or some misconfiguration.

Could anyone provide insights or suggestions on how to troubleshoot and resolve this hydration error? I'll provide de error logs bellow.

Environment:

  • React Native version: 0.72.6
  • Storybook version: ^6.5.7
  • Expo version: ~49.0.15

Thank you for your help!

error 1 error 2

0

There are 0 best solutions below