React State Object updating without setState

React State Object updating without setState


class FilterMenu extends Component {
    this.state = { 
        min: 0,
        max: this.getFormatedPrice(this.props.category_maxPrice,false),
        minValue: '',
        maxValue: '',
        searchTerm: '', 
        data: this.props,
        checkedBoxes: [],
        initialFilters: this.props.filters,
        filters: this.props.filters,   

    this.onInputChange      = this.onInputChange.bind(this);


    let substr =;

    {(() => {
        var targetFilter =;
        var initialFilterItems = this.initialFilters[targetFilter].items;
        var newFilters = _.extend({}, this.state.filters);
        newFilters[targetFilter].items = initialFilterItems.filter(function(item){
            return item.title.toLowerCase().search( !== -1;
        this.setState({ filters: newFilters });


I just want to update "filters" state, which holds some data from "initialFilters". But when I use this.setState({ filters: newFilters }), it's updating "initialFilters" also

Appreciate your support.

Angular 9 Tutorial: Learn to Build a CRUD Angular App Quickly

What's new in Bootstrap 5 and when Bootstrap 5 release date?

Brave, Chrome, Firefox, Opera or Edge: Which is Better and Faster?

How to Build Progressive Web Apps (PWA) using Angular 9

What is new features in Javascript ES2020 ECMAScript 2020

An intro to Redux and how state is updated in a Redux application

I started learning Redux a few days back and it was an overwhelming concept for me at the start. After polishing my skills in ReactJS by making a&nbsp;<a href="" target="_blank">personal book reading application</a>, I headed towards Redux to learn more about it.

React Boilerplates with Redux, Redux Saga and Best Practices

React Boilerplates with Redux, Redux Saga and Best Practices