onClick={ this.props.remove(this.props. + this.props.title) }
How can I accomplish to have this.props.custom_variable_name which is coming from the variable this.props.title
This example doesnt work
Use bracket notation
onClick={() => this.props.remove(this.props[this.props.title])}
eval. Like in this.props.remove(eval(title));. It would work with properties too, but not only is it vastly slower, it's actually pretty risky (enabling code injection attacks if not safeguarded enough.)You can use bracket notation
onClick={ () => this.props.remove(this.props[this.props.title]) }
this.props.remove? As I understood you have loop, could you post it?