-
Notifications
You must be signed in to change notification settings - Fork 151
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
Markers 组件在重新渲染时,初始数据一直被保留了 #237
Comments
请问问题解决了吗?我也刷新不了点 |
markers/index.js里refreshMarkersLayout中有一句,判断数组是否相等。 |
看了repo之后,这个问题应该是strictMode的重复渲染问题导致的。 |
问题描述
在首次渲染Markers组件的时候传入了一批点,然后通过click事件重新刷新markers的数据,组件重新渲染,但是第一批传入的点始终存在,并没有被生成的新的点刷新。
重现示例
示例中包含了相应的React的版本,以及react-amap的版本
https://github.com/hiveer/amap-app
Markers 组件再渲染的时候会渲染出两倍的marker节点,也就是我传入2个点,会渲染出4个来,只重合了所以看起来还是两个
The text was updated successfully, but these errors were encountered: