1
我總是得到錯誤是這樣的:終極版無法讀取架構Normalizr
Uncaught (in promise) TypeError: Cannot read property 'periodListSchema' of undefined
這裏是我的代碼:
我的架構
import { schema, arrayOf } from 'normalizr';
export const periodSchema = new schema.Entity('activePeriod');
export const periodListSchema = new schema.Array(periodSchema);
我正常化行動
這是我的迴應
{"activePeriod":[{"periodID":2,"periodName":"Periode 27","startDate":"2016-11-11","endDate":"2016-12-11","remark":"Periode Alpha 27","isActive":"1"}],"status":"OK"}
我Normalzr庫V3.2.2 有人可以幫我找出什麼是錯的?我試圖理解這一點。
我得到這個錯誤:錯誤:給定的歸一化輸入意外。預期類型爲「對象」,找到「未定義」。 正常化 – ukiyakimura
我已經解決了這個問題。忘記指定更多。我的response.data.activePeriod。無論如何 – ukiyakimura