使用React Antd的时候刚进入Welcome页面就会报 key 错误?

KevinAtlans
  • 1
新手上路,请多包涵

使用React Antd的时候刚进入Welcome页面就会报 key 错误?

Warning: Each child in a list should have a unique "key" prop.

Check the render method of `Welcome`. See https://reactjs.org/link/warning-keys for more information.
    at Welcome (http://127.0.0.1:8000/p__Welcome.js:157:5)
    at LoadableComponent (http://127.0.0.1:8000/mf-dep_vendors-node_modules_umi_node_modules_umijs_runtime_dist_index_esm_js.781db3b3.async.js:393:68)
    at Route
    at Switch
    at WithExceptionOpChildren (http://127.0.0.1:8000/.umi__plugin-layout__Layout.js:222:24)
    at main
    at Basic (http://127.0.0.1:8000/mf-dep_vendors-node_modules_antd_es_menu_index_js.6a8ca525.async.js:384:25)
    at Adapter (http://127.0.0.1:8000/mf-dep_vendors-node_modules_antd_es_menu_index_js.6a8ca525.async.js:367:66)
    at ErrorBoundary (http://127.0.0.1:8000/mf-dep_vendors-node_modules_ant-design_pro-layout_es_index_js-node_modules_antd_es_alert_style_index_less.960a58e7.async.js:4900:87)
    at FormProvider (http://127.0.0.1:8000/mf-dep_vendors-node_modules_antd_es_config-provider_SizeContext_js-node_modules_rc-field-form_es_index_js.705af8ad.async.js:2530:31)
    at LocaleProvider (http://127.0.0.1:8000/mf-dep_vendors-node_modules_antd_es_config-provider_index_js-node_modules_antd_es_message_index_js.7118c033.async.js:910:87)
    at ProviderChildren (http://127.0.0.1:8000/mf-dep_vendors-node_modules_antd_es_config-provider_index_js-node_modules_antd_es_message_index_js.7118c033.async.js:740:24)
    at LocaleReceiver (http://127.0.0.1:8000/mf-dep_vendors-node_modules_antd_es_config-provider_context_js.11c57bb9.async.js:721:87)
    at ConfigProvider (http://127.0.0.1:8000/mf-dep_vendors-node_modules_antd_es_config-provider_index_js-node_modules_antd_es_message_index_js.7118c033.async.js:848:13)
    at SWRConfig$1 (http://127.0.0.1:8000/mf-dep_vendors-node_modules_ant-design_icons_es_icons_CopyOutlined_js-node_modules_ant-design_icons_-6a467b.97f20def.async.js:4483:23)
    at ConfigProviderWrap (http://127.0.0.1:8000/mf-dep_vendors-node_modules_ant-design_icons_es_icons_CopyOutlined_js-node_modules_ant-design_icons_-6a467b.97f20def.async.js:333:23)
    at WrapContent (http://127.0.0.1:8000/mf-dep_vendors-node_modules_ant-design_pro-layout_es_index_js-node_modules_antd_es_alert_style_index_less.960a58e7.async.js:819:21)
    at div
    at section
    at BasicLayout (http://127.0.0.1:8000/mf-dep_vendors-node_modules_antd_es_menu_index_js.6a8ca525.async.js:399:63)
    at Adapter (http://127.0.0.1:8000/mf-dep_vendors-node_modules_antd_es_menu_index_js.6a8ca525.async.js:367:66)
    at div
    at Provider (http://127.0.0.1:8000/mf-dep_vendors-node_modules_antd_es_alert_ErrorBoundary_js-node_modules_antd_es_alert_index_js-node_-578a5c.52896ae9.async.js:408:31)
    at BasicLayout (http://127.0.0.1:8000/mf-dep_vendors-node_modules_ant-design_pro-layout_es_index_js-node_modules_antd_es_alert_style_index_less.960a58e7.async.js:245:67)
    at BasicLayout (http://127.0.0.1:8000/.umi__plugin-layout__Layout.js:701:24)
    at http://127.0.0.1:8000/.umi__plugin-layout__Layout.js:41:19
    at LoadableComponent (http://127.0.0.1:8000/mf-dep_vendors-node_modules_umi_node_modules_umijs_runtime_dist_index_esm_js.781db3b3.async.js:393:68)
    at Route
    at Switch
    at Router (http://127.0.0.1:8000/mf-dep_vendors-node_modules_react-router-dom_esm_react-router-dom_js.d5bd3186.async.js:2887:30)
    at RouterComponent (http://127.0.0.1:8000/mf-dep_vendors-node_modules_babel_runtime_helpers_esm_objectWithoutPropertiesLoose_js-node_modules_b-7797da.01cd6999.async.js:610:23)
    at http://127.0.0.1:8000/umi.js:1223:24
    at http://127.0.0.1:8000/umi.js:1861:23

不知道在哪儿可以配置这个key??
求教大神

回复
阅读 259
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
宣传栏