I am calling an asynchronous function, and based off that response, the function should be returning a different React Native Element. I have written simpler code that creates the same error.
async function doNothing(){ };
class RouterComponent extends Component {
render() {
return(
doNothing().then(()=> {
return(
<View></View>
);
})
The error I am getting is
A Valid React element or (null) must be returned. You may have returned undefined, an array, or some other invalid object.
I am returning a valid React element within the .then(statement)
. How would I change it so it returns the React Element.