React-Native Invariant Violation: Element type is invalid

后端 未结 4 1771
别跟我提以往
别跟我提以往 2021-01-07 18:41

When I going to run my react native app on my iPhone Expo this error displayed in red background area.

Invariant Violation: Element type is invalid: e

4条回答
  •  走了就别回头了
    2021-01-07 18:47

    I had this error from doing my export in the following style with no default export specified. I did not specify a default because I was exporting multiple small components from one file.

    export const  Modal  = (props) => (
        
    )

    I was able to get it working by adding brackets to the import statement.

    import {Modal} from '../components/Modal.js'
    

提交回复
热议问题