I am getting this error: Type 'false | Element' is not assignable to type 'Element'.
I am using React and TypeScript and the code looks like:
function App() {
const [isSearching, setIsSearching] = useState(false);
return (
{isSearching && <div> Hey </div>}
)
}
{isSearching && <div> Hey </div>} is giving the above error
Can anyone please help me point out what I may be missing here?