简体   繁体   中英

Root state of redux/react-native app undefined

When I add this line: import { makePages } from './pages'

I get the error:

Cannot read property 'product' of undefined

pages/index.js

export * from './add'
export { makePages } from './model'
export * from './reducer'

pages/model.js

import type { RecordFactory, RecordOf } from 'immutable'
import { Record } from 'immutable'

export const makePages: RecordFactory<any> = Record({
  height: 5
})

export type Pages = RecordOf<any>

I'm not even using makePages in the file and it gets the error.

product/model.js

import type { RecordFactory, RecordOf } from 'immutable'
import { Record } from 'immutable'
import { makePages } from './pages'
const makeProduct: RecordFactory<any> = Record({
  pages: 3
})
let product = new makeProduct()
export { product }

Why does import { makePages } from './pages' cause the error?

在此处输入图片说明

Actually when I delete export * from './add' the error does not occur so I just need to make sure I'm exporting correctly. Possibly should export everything individually rather than all *

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM