iamacup / react-native-markdown-display

React Native 100% compatible CommonMark renderer
MIT License
564 stars 166 forks source link

Remount issue for AST nodes #205

Closed ddx-510 closed 6 months ago

ddx-510 commented 6 months ago

The root layout has a unique key which makes the whole component remounting each time outer layer changes

ddx-510 commented 6 months ago

I managed to resolve this by making the root have a key 'root' instead of the getUniqueKey() and for each ast node, use Type + tokenIndex to avoid remounting issues.

https://www.npmjs.com/package/@ddx0510/react-native-markdown-display