Nothing was Returned from Render – React Native

Nothign was returned from render is a very basic and common React Native error. What’s the problem it’s easily to figure out from the error message.

Basically it boils down to having a render() function but with no return statement.

This means somewhere in your code you have a render function that looks like this:

import React, { Component } from 'react';
import {View, Button } from 'react-native';

class Home extends Component {
    render() {
        <View>
            <Button title="Go to settings..." onPress={() => this.props.navigation.navigate('Settings')}/>
        </View>
    }
}

export default Home;

And it should look like this. Mind the highlighted lines.

import React, { Component } from 'react';
import {View, Button } from 'react-native';

class Home extends Component {
    render() {
        return (
            <View>
                <Button title="Go to settings..." onPress={() => this.props.navigation.navigate('Settings')}/>
            </View>
        );
    }
}

export default Home;
FacebookTwitterLinkedin