question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`Uncaught Error: must set key for <rc-animate> children` on modal

See original GitHub issue

When using preact and modals, I’m getting Uncaught Error: must set key for <rc-animate> children.

The issue seems to be due to https://github.com/react-component/dialog/blob/master/src/Dialog.tsx#L191 needing a key for rc-animate to not complain.

I don’t know why this is not thrown if I use react.

Here the stacktrace.

Animate.js:290 Uncaught Error: must set key for <rc-animate> children
    at http://localhost:3011/client/index.js:147664:17
    at Array.map (native)
    at cl.render (http://localhost:3011/client/index.js:147659:32)
    at callMethod (http://localhost:3011/client/index.js:1178:12)
    at cl.render (http://localhost:3011/client/index.js:1186:12)
    at renderComponent (http://localhost:3011/client/index.js:146284:60)
    at setComponentProps (http://localhost:3011/client/index.js:146265:103)
    at buildComponentFromVNode (http://localhost:3011/client/index.js:146354:13)
    at idiff (http://localhost:3011/client/index.js:146160:48)
    at innerDiffNode (http://localhost:3011/client/index.js:146211:21)(anonymous function) @ Animate.js:290render @ Animate.js:285callMethod @ index.js:442(anonymous function) @ index.js:450renderComponent @ preact.js:303setComponentProps @ preact.js:284buildComponentFromVNode @ preact.js:373idiff @ preact.js:179innerDiffNode @ preact.js:230idiff @ preact.js:196innerDiffNode @ preact.js:230idiff @ preact.js:196diff @ preact.js:157renderComponent @ preact.js:326renderComponent @ preact.js:317setComponentProps @ preact.js:284buildComponentFromVNode @ preact.js:373idiff @ preact.js:179diff @ preact.js:157render @ preact.js:409render @ index.js:142renderSubtreeIntoContainer @ index.js:160_renderComponent @ getContainerRenderMixin.js:47componentDidMount @ getContainerRenderMixin.js:59callMethod @ index.js:442(anonymous function) @ index.js:450flushMounts @ preact.js:149renderComponent @ preact.js:354setComponentProps @ preact.js:284renderComponent @ preact.js:310setComponentProps @ preact.js:284renderComponent @ preact.js:310setComponentProps @ preact.js:284renderComponent @ preact.js:310setComponentProps @ preact.js:284renderComponent @ preact.js:310setComponentProps @ preact.js:284renderComponent @ preact.js:310setComponentProps @ preact.js:284renderComponent @ preact.js:310setComponentProps @ preact.js:284renderComponent @ preact.js:310setComponentProps @ preact.js:284renderComponent @ preact.js:310setComponentProps @ preact.js:284renderComponent @ preact.js:310setComponentProps @ preact.js:284renderComponent @ preact.js:310setComponentProps @ preact.js:284renderComponent @ preact.js:310setComponentProps @ preact.js:284renderComponent @ preact.js:310setComponentProps @ preact.js:284renderComponent @ preact.js:310setComponentProps @ preact.js:284renderComponent @ preact.js:310setComponentProps @ preact.js:284renderComponent @ preact.js:310setComponentProps @ preact.js:284renderComponent @ preact.js:310setComponentProps @ preact.js:284renderComponent @ preact.js:310setComponentProps @ preact.js:284renderComponent @ preact.js:310setComponentProps @ preact.js:284renderComponent @ preact.js:310setComponentProps @ preact.js:284renderComponent @ preact.js:310forceUpdate @ preact.js:472(anonymous function) @ History.js:46(anonymous function) @ createTransitionManager.js:66notifyListeners @ createTransitionManager.js:65setState @ createBrowserHistory.js:99(anonymous function) @ createBrowserHistory.js:188confirmTransitionTo @ createTransitionManager.js:44push @ createBrowserHistory.js:168StaticRouter._this.transitionTo @ StaticRouter.js:46Link._this.handleTransition @ Link.js:55Link._this.handleClick @ Link.js:46eventProxy @ preact.js:130

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:11 (1 by maintainers)

github_iconTop GitHub Comments

15reactions
fygethubcommented, Jun 6, 2018

I got this error today , finally i solve it by this

//before
setFieldsValue({
     fileList,
   });

//after
 setFieldsValue({
     fileList: fileList.map(item => ({
          ...item,
          uid: getUUid(),
        })),
   });

by add uid filed

14reactions
ViGi-Pcommented, Oct 10, 2017

I’m facing this same problem with react. 😦 When using Upload inside Modal.

Read more comments on GitHub >

github_iconTop Results From Across the Web

must set key for <rc-animate> children` on modal #4120
When using preact and modals, I'm getting Uncaught Error: must set key for <rc-animate> children . The issue seems to be due to ......
Read more >
must set key for <rc-animate> children on modal(React- ...
Uncaught Error : must set key for <rc-animate> children on modal(React-select)解决方式 const newDefaultValue = defaultValue.filter(e => e !== ...
Read more >
Uncaught Error: must set key for <rc-animate> children 解决办法
描述: 今天在页面跳转的时候遇到了一个UncaughtError:mustsetkeyfor children的问题,主要是因为mode属性造成,...,CodeAntenna技术文章技术问题代码片段及聚合.
Read more >
Uncaught Error: must set key for <rc-animate> children
TreeSelect treeCheckStrictly true: Uncaught Error: must set key for <rc-animate> children · Overview · Backers (0) · Updates ...
Read more >
React Antd Modal Property 'children' does not exist on type ...
Issue is related to latest updates of types in react 18. In order to avoid this error if you use yarn ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found