React Native - Nothing was returned from render

前端 未结 2 1945
[愿得一人]
[愿得一人] 2021-01-19 22:22

My application is stored in /src/index.js but i also have a /App.js and a /index.js.

I don\'t know the difference between these and i think thats the reason im getti

2条回答
  •  广开言路
    2021-01-19 22:52

    Your default export is not returning anything :

    export default () => {
    
        
            
        
    
    }
    

    To return JSX with an arrow function you need to use () => ( ) or the equivalent with curly braces : () => { return ( ) } :

    export default () => (    
        
            
        
    )
    

    or :

    export default () => {
        return (    
           
               
           
       )
    }
    

提交回复
热议问题