Gavin Armitage
Aug 9, 2017 · 1 min read

Hi Tanner, Thanks so much for the great component. Was hoping to get some help on the Slack channel but shows as inactive….

Still new to React. Anyway, I am wanting to invoke a bound function({props.removeMapping}) through props in a column where i have added a Delete Row button. Function is on my app component.

const columns = [

{

Header: ‘Action’,

accessor: ‘id’,

Cell: props => <span className=’number’><DeleteButton removeMapping={props.removeMapping} id={props.value} /></span>,

filterable: false

}]

App Component

removeMapping(id) {

console.log(‘id to delete’,id);

//const remainder = this.state.data.filter((todo) => {

// if (todo.id !== id) return todo;

//});

//// Update state with filter

//this.setState({ data: remainder });

}

render() {

const { data } = this.state;

return (

<div>

<ButtonNew addMapping={this.handleAddNew} />

<ReactTable

data={data}

columns={columns}

filterable

loading={this.state.loading}

defaultPstatusSize={50}

className=”-striped -highlight”

removeMapping={this.handleDelete}

/>

<br />

</div>

);

}

Anyway to do this?