Yes, there is a way in which you can add attributes to a React component when certain conditions are met.
React has the ability to omit an attribute if the value passed to it is not true.
Consider the following example:
var condition = true;
var component = (
);