I would like to know if it is possible to set onClick on a div element in react based on the value of a property in my case canClick.
onClick
canClick
I am awar
You can treat the elements attributes (like onClick) as object properties. Use the spread operator to only on condition, spread the onClick:
hello