خرید بک لینک

Vote count: 0

I've been leaing how react for the past few weeks and one thing that I don't like is that I have to use teary operator for if else inside the render function.

Something like :

function render() {
    retu (
        {x==="Let's go" ? <Go /> : <Hold on />}
    )
}

Is there a way I can use traditional If-else or switch for that matter with jsx syntax in react?

asked 1 min ago

برچسب: نویسنده: استخدام کار تاريخ: شنبه 22 خرداد 1395 ساعت: 19:06

صفحه بندی