"Nothing was returned from render." ReactJS error

Published under React

📺 Click here to skip to the video attached to this post 👇

Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.

This warning happens when you're missing a return statement in your render function, or you attempt to return early, but return void via return; instead of returning null.

function App() {
    if (props.loading) {
        return; // Bad! Should return `null` here instead

    return null; // Fixed!