I have this conditional rendering
{livematchcard.event.status_name != "Ολοκληρώθηκε" ? "Τελικό"
: (livematchcard.event.sport_id == 4 ? (
(livematchcard.event.status_id == 134 ? livematchcard.periods[0] : null)
(livematchcard.event.status_id == 65 ? livematchcard.periods[1] : null)
(livematchcard.event.status_id == 135 ? livematchcard.periods[2] : null)
(livematchcard.event.status_id == 136 ? livematchcard.periods[3] : null)
(livematchcard.event.status_id == 137 ? livematchcard.periods[4] : null)
) : livematchcard.event.clock_time)
}
So, the problem is that I can see the clock time where I should but if a condition inside is met for example is status_id is 134 I get the following error which I cannot seem to understand Uncaught TypeError: (intermediate value)(intermediate value)(intermediate value) is not a function. I also tried to change the code to this
livematchcard.event.status_id == 134 && livematchcard.periods[0]
where I get the following error
livematchcard.periods[0] is not a function
livematchcard.periods[x]value. That can then be rendered inline without a wall of ternary statements.(some_expression)(another_expression)then that means the result ofsome_expressionis to be invoked as a function and passed the result ofanother_expressionas the argument to that function. Which clearly isn't the intent here. But then what is the intent? It appears that you've confused yourself with the structure, making the actual intent unclear. Outside of React, isolate just this logic and define exactly what this overall expression should be resolving to.