Refactor: Simplify conditional rendering in FetchApi component
This commit is contained in:
parent
52fc2b5e07
commit
bc880295c4
@ -21,15 +21,11 @@ export const FetchApi = () => {
|
|||||||
>
|
>
|
||||||
Fetch API
|
Fetch API
|
||||||
</button>
|
</button>
|
||||||
<div className="mt-4">
|
|
||||||
{date ? (
|
{date ? (
|
||||||
<p className="text-white">Server time: {date}</p>
|
<p>Server time: {date}</p>
|
||||||
) : (
|
) : (
|
||||||
<p className="text-white">
|
<p>Click the button to fetch the API</p>
|
||||||
Click the button to fetch the API
|
|
||||||
</p>
|
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user