JavaScript Maximum call stack size exceeded - Connected React Component maximum call stack size exceeded,maximum call stack size exceeded

I can't for the life of me figure out why I'm getting error:

Maximum call stack size exceeded

When this code is run. If I comment out:

const tabs = this.getTabs(breakpoints, panels, selectedTab);

the error goes away. I have even commented out other setState() calls to try and narrow down where the problem was at.

Code (removed the extra functions):

export default class SearchTabs extends Component {
  constructor() {
    super();
    this.state = {
      filters: null,
      filter: null,
      isDropdownOpen: false,
      selectedFilter: null,
    };

    this.getTabs = this.getTabs.bind(this);
    this.tabChanged = this.tabChanged.bind(this);
    this.setSelectedFilter = this.setSelectedFilter.bind(this);

    this.closeDropdown = this.closeDropdown.bind(this);
    this.openDropdown = this.openDropdown.bind(this);
  }

  componentDidMount() {
    const { panels } = this.props;
    if (!panels || !panels.members || panels.members.length === 0) {
      this.props.fetchSearch();
    }
  }


  getTabs(breakpoints, panels, selectedTab) {
    const tabs = panels.member.map((panel, idx) => {
      const { id: panelId, headline } = panel;
      const url = getHeaderLogo(panel, 50);
      const item = url ? <img src={url} alt={headline} /> : headline;

      const classname = classNames([
        searchResultsTheme.tabItem,
        (idx === selectedTab) ? searchResultsTheme.active : null,
      ]);

      this.setState({ filter: this.renderFilters(
        panel,
        breakpoints,
        this.setSelectedFilter,
        this.state.selectedFilter,
        this.state.isDropdownOpen,
      ) || null });

      return (
        <TabItem
          key={panelId}
          classname={`${classname} search-tab`}
          headline={headline}
          idx={idx}
          content={item}
          onclick={this.tabChanged(idx, headline)}
        />
      );
    });

    return tabs;
  }

  render() {
    const { panels, selectedTab } = this.props;

    if (!panels || panels.length === 0) return null;

    const tabs = this.getTabs(breakpoints, panels, selectedTab);

    return (
      <div className={searchResultsTheme.filters}>
        <ul className={`${searchResultsTheme.tabs} ft-search-tabs`}>{tabs}</ul>
        <div className={searchResultsTheme.dropdown}>{this.state.filter}</div>
      </div>
    );
  }
}

export const TabItem = ({ classname, content, onclick, key }) => (
  <li key={key} className={`${classname} tab-item`} onClick={onclick} >{content}</li>
);
Answer:1

Hi I just started using AngularJs, I am having issue when using $http to get data and $scope.productInfos = data returns Error: [ngRepeat:dupes], below is my code: $scope.processForm = function(...

Hi I just started using AngularJs, I am having issue when using $http to get data and $scope.productInfos = data returns Error: [ngRepeat:dupes], below is my code: $scope.processForm = function(...

  1. angularjs error ngrepeat dupes
  2. angular ng repeat dupes error
  3. ngrepeat dupes

Hi I'm trying to figure out how to set up the key in a symbol iterator, this is the code I have so far: let james = { name: 'James', height: `5'10"`, weight: 185 }; james[Symbol.iterator]...

Hi I'm trying to figure out how to set up the key in a symbol iterator, this is the code I have so far: let james = { name: 'James', height: `5'10"`, weight: 185 }; james[Symbol.iterator]...

  1. javascript generator function uses
  2. javascript generator function in class
  3. javascript generator function yield
  4. javascript generator function arrow
  5. javascript generator function next
  6. javascript generator function return
  7. javascript generator function example

I'm trying to test a REST API built with express and mongoose, I'm using jest and supertest for the http calls; also I'm relatively new to testing with javascript. When testing a creation url I wan't ...

I'm trying to test a REST API built with express and mongoose, I'm using jest and supertest for the http calls; also I'm relatively new to testing with javascript. When testing a creation url I wan't ...

  1. jest testing mongoose
  2. jest test mongoose model

I can't for the life of me understand why anyone would even want this rule let alone what it means. I want to return something here in the render export default class SearchTabs extends Component { ...

I can't for the life of me understand why anyone would even want this rule let alone what it means. I want to return something here in the render export default class SearchTabs extends Component { ...

  1. eslint-rule-react-hooks
  2. eslint rule react/prop-types
  3. eslint rules react
  4. eslint rules react native
  5. eslint rules create react app
  6. (eslint) definition for rule 'react/jsx-sort-prop-types' was not found
  7. eslint definition for rule 'react/require-extension' was not found
  8. (eslint) definition for rule 'react/wrap-multilines' was not found
  9. eslint definition for rule react was not found
  10. eslint configuration for rule react/jsx-no-bind is invalid
  11. eslint definition for rule 'react/jsx-filename-extension' was not found
  12. eslint configuration for rule react/jsx-boolean-value is invalid
  13. eslint definition for rule 'react-hooks/exhaustive-deps' was not found
  14. eslint-plugin-react rule
  15. disable eslint rule create react app
  16. eslint airbnb configuration for rule react/jsx-no-bind is invalid
  17. eslint error while loading rule 'react/no-direct-mutation-state'