I am trying to make an onClick with a condition but have an issue when trying to pass with a parameter.
The reason I want to do this is because inside the TableRow I have button that is only visible on desktop. But when people are on 900px and below I want to make it possible to click the entire row. The IsDesktop returns true or false depending on wether the user is over or under 900px
<TableRow hover key={site.id} onClick={isDesktop&&(e)=>handleSubmit(e,site.url)}>
<TableRowSite site={site} index={index} />
</TableRow>
This is what I have tried so far. But it keeps giving me an error.
Parsing error: Unexpected token, expected "}" (31:67)
I have seen several tutorials using a condition in the onClick but never with a parameter but I believe it is possible as it makes sense.