i want to render jsx based on condition using react.
if condition1 and condition2 should display button add. if condition1 and !condition2 should display button click me
below is my code,
render = () => {
return (
{condition1 && condition2 && (
<button>add</button>
)}
{condition1 && !condition2 && (
<button>click me </button>
)}
);
}
how can i rewrite above code using ternary operator. could someone help me fix this. thanks.