Skip to content

Commit b3cc81e

Browse files
5ZYSZ3KMatiPl01
authored andcommitted
Fix the issue with next.js throwing errors while hydrating (#8869)
## Summary Fixing the issue with next.js throwing errors while hydrating: #8842 I'm not proud of my solution. I tried to utilize `useId` from react as a source for the ID there, which would make the ID synchronized between the server and the browser, but it's producing a string ID, and it couldn't work there. However, as I deleted the `nativeID` prop on web, everything seemed to be working (?). I don't know the possible edge cases well, so please confirm or reject my PR ## Test plan One can run the `next-example` app which is provided in the repo with and without my change, refresh the page a couple of times while observing the console - hydration errors should disappear
1 parent c280b69 commit b3cc81e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/react-native-reanimated/src/createAnimatedComponent/AnimatedComponent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@ export default class AnimatedComponent
515515
jestAnimatedStyle: this.jestAnimatedStyle,
516516
jestAnimatedProps: this.jestAnimatedProps,
517517
};
518-
} else if (!skipEntering) {
518+
} else if (!skipEntering && !IS_WEB) {
519519
nativeID = `${this.reanimatedID}`;
520520
}
521521

0 commit comments

Comments
 (0)