Table組件的dataSource
表現:報錯,warning,缺少key。
解決方案:數據處理增加key值即可
例如在model的reducer里
codeList: list.map(v => { v.key = v.id return v }),
ESLint的報錯 error Identifier '' is not in camel case @typescript-eslint/camelcase
現象描述:后端傳遞給前端的字符不一定是標准的駝峰,有時是下划線,所以有時候會過不了lint檢測
解決方案:添加自己的規則
// .eslintrc.js module.exports = { extends: [require.resolve('@umijs/fabric/dist/eslint')], globals: { ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION: true, page: true, REACT_APP_ENV: true, }, rules: { '@typescript-eslint/camelcase': 'off', }, };