I have a functional react component which uses custom hook useTimer.This component receives data from API(via redux store).
function RenderRespond(order) {
if(order === null) return;
const {
buyerName,
offerDuration,
} = order;
const {
seconds,
minutes,
} = useTimer(offerDuration);
return(
<div>
{BuyerName}
{minutes}:{seconds}
</div>
);
}
I only want to render this component when order is not null.The code throws the error that hooks cannot be conditionally rendered.How can I achieve this?