You can achieve what you are saying by using Immediately Invoked Function Expression (IIFE)
render() {
return (
{(() => {
if (this.state == 'news'){
return (
data
)
}
return null;
})()}
)
}
Here is the working example:
But, In your case, you can stick with the ternary operator