#Toggle data in React

1 messages · Page 1 of 1 (latest)

inner stratus
#

@covert sandal A bit hard to say.

#

Since that "Released"/"Suspended" isn't a simple boolean property that can change, but something that's calculated based on the logic in getSuspended - it's not a simple "flip this string from one value to another"

#

I guess since there's:

if (data.marketSuspended === 1) {
    return "Suspended";
}

you could set marketSuspended to 1 to toggle from "Released" to "Suspended", but I'm not sure what you'd set it to to go back the other way.