How can I check in React if a map function is empty or not inside the return section? wanna check If it's empty, if so render an empty array, otherwise wanna render everything by mapping the content. I am asking because rendering an empty array this way will cause an exception..
return (
{functionName.map((...}
)
{functionName.map.lengh().? ...}
)
Looks like the quickest way around this is by adding a "?" mark to the function name like this?
{functionName?.map.((item)=>...}