The percise error I'm getting (when I start to type in textbox) in my log is:
Uncaught TypeError: _this.props.setTextFilter is not a function
at ExpListFilters._this.onTextChanged (ExpListFilters.js:17)
Here is my function:
onTextChanged = (e) => {
this.props.setTextFilter(e.target.value);
};
Rendered inside component:
<div className="in-group__item search-box">
<input placeholder="Search for your expenses"
className="text-input"
type="text"
value={this.props.filters.text}
onChange={this.onTextChanged}/>
</div>
Also using redux to map state to props by passing down filters from actions.
import { setTextFilter } from '../actions/filters'
Redux:
const mapStateToProps = (state) => ({
filters: state.filters
});