Conditional Rendering Inside A Function
问题 I have seen multiple examples but none of them fit my problem. I want to use conditional rendering inside a functional component. For example, if the user is not logged in and a token is not present in the local storage, when the login form is submitted, I want to display a message that login is invalid. if (!localStorage.getItem('token')) { return <Typography>Login Invalid</Typography> console.log('Login Not possible'); } For now, I tried to make it a separate function and called it in