You can initialize an object with a computed property name, and then use JSX Spread Attributes to convert it to attribute:
const DemoComponent = ({ variablePropName, variablePropValue }) => {
const variableAttribute = { [variablePropName]: variablePropValue };
return (
);
};