gloriasoft / veaury

Use React in Vue3 and Vue3 in React, And as perfect as possible!
MIT License
1.27k stars 81 forks source link

React exception: Warning: Encountered two children with the same key, `0`. Keys should be unique #121

Closed nhaustov closed 4 months ago

nhaustov commented 4 months ago

When applyPureReactInVue has two or more Vue component children, there is exception in browser console. This can be reproduced by copying VueCom1 under AAWithPure in dev-project-vue3/src/pages/pureReactInVue/index.vue (diff attached). I am not sure if it is causing any problems, however in my bigger application, there are many exceptions happening and it is not always clear where they are coming from. Workaround is to wrap VueCom1 in div, however it is not always feasible.

react-dom.development.js:86 Warning: Encountered two children with the same key, 0. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and/or omitted — the behavior is unsupported and could change in a future version. at div at AA (webpack-internal:///./src/pages/pureReactInVue/react_app/AA.js:26:12) at r (webpack-internal:///./node_modules/veaury/dist/veaury.esm.js:29:8395) at l (webpack-internal:///./node_modules/veaury/dist/veaury.esm.js:29:8853)

diff.txt

devilwjp commented 4 months ago

@nhaustov try 2.3.17