I'm trying to pass a remove function into the map with a parameter, but it's like I'm not using my function. What would be the correct way to call ''remove(i)'' inside InputTime in onRemove?
Component static propTypes = { values: PropTypes.array.isRequired, remove: PropTypes.func.isRequired }; render() { const {values, remove} = this.props; if(!values) return null; return(<> {values.map((hour, i) => (<Container scope={getField(i)} key={i}><InputTime time={hour} onRemove={() => remove(i)} {...this.props} /></Container> ))} </> ) }}// another class handlerRemove(){ ... }return(<Component values={values} remove={() => this.handlerRemove()} />)