Here's my code, and I would like to get rid of this because it's causing me lint errors, but I don't have idea how to refactor this to get this somehow cleaner etc..
(这是我的代码,我想摆脱它,因为它会导致我出现棉绒错误,但是我不知道如何重构它,以使其更清洁。)
formatter: value => {
switch (value) {
case PRODUCT_STATUS.Sold:
return (
<span className="product">
PRODUCT
</span>
);
case PRODUCT_STATUS.OnStock:
return (
<span className="product success">
ON STOCK
</span>
);
case PRODUCT_STATUS.Expired:
return (
<span className="product error">
EXPIRED
</span>
);
default:
return 'STATUS DEFAULT';
}
}
Thanks guys
(多谢你们)
Cheers
(干杯)
ask by Roxy'Pro translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…