score:2
replace this:
onclick={this.remove(i)}
by this:
onclick={() => this.remove(i)}
explanation: while rendering, react evaluates this.remove(i)
, which changes the state or the props, thus triggering another render, and looping to re-evaluate this.remove(i)
; creating a (hidden) infinite loop. () => this.remove(i)
is a function so the state or the props do not change. also, it's probably what you wanted to code anyway ;)
Source: stackoverflow.com
Related Query
- React warning Maximum update depth exceeded
- react - maximum update depth exceeded using react-table
- React js, Maximum update depth exceeded
- React - Invariant Violation: Maximum update depth exceeded
- React Maximum update depth exceeded error caused by useEffect only in test
- Maximum update depth Exceeded during React Easy Crop
- Maximum update depth exceeded in React Infinite Scroll
- React App Login Error : Maximum update depth exceeded
- React maximum update depth exceeded | useEffect dependencies
- React error: warning maximum update depth exceeded
- React setState inside componentDidUpdare leads to Maximum update depth exceeded
- Maximum update depth exceeded in React error
- RESOLVE : react error : Maximum update depth exceeded
- React Maximum update depth exceeded in functional component
- Error with React Stripe split card elements: Maximum update depth exceeded
- Maximum update depth exceeded - React Js
- React maximum update depth exceeded | useEffect with user from firebase
- React js Maximum update depth exceeded
- React Custom Hook produce warning: Maximum update depth exceeded
- Maximum update depth exceeded react
- React redirect causes error: Maximum update depth exceeded
- React question: Error: Maximum update depth exceeded
- React JS Hooks - Maximum update depth exceeded
- React error in console - Maximum update depth exceeded when input length is more than 5
- Maximum update depth exceeded with react context api
- React JSX: Maximum update depth exceeded
- Maximum update depth exceeded error in react app
- React Tutorial: Maximum update depth exceeded
- React Typescript with hooks : Maximum update depth exceeded error
- React : Maximum update depth exceeded
More Query from same tag
- Fixed column in prime react datatable without jquery
- Bind different action creator on different pages
- Testing a react component using useSelector hook
- Unable to import react component to my app.js
- How can I select a state property object name dinamically to change one of its properties(childs?) on react?
- ReactJS: how to trigger form submit event from another event
- How to assign classes to properties of "new () =>" type
- NodeJs: Serve image, stored on AWS S3, to client img tag
- page not loading react js
- generating table rows for objects with children
- Getting Year from Javascript Date
- call to onBlur gives TypeError: (destructured parameter) is undefined
- Jest(react testing tool) error - Parse Error: Line 1: Illegal import declaration
- Fetch axios call only one time when render page
- Handle multiple input value change within an object
- How to set multiple object values when using Immutable JS map
- How to test functionality of function props in storybook?
- React- hover effect to hide div doesn't work
- Formsy react validation ( server response )
- Mixing strings and html links in react/typescript constants
- Moving road background image
- How to solve map loop not working to print data ( component ) ? React
- React with TypeScript - how to import methods
- FloatingActionButton z-index change delay
- Framer motion modal - Animate presence does not work
- Label list is not showing in recharts?
- Immediately run a function on page load
- How to use createjs in reactjs
- Writing a program in react when mouseover on parent element add child element to coressponding parent element
- Why does my mock of my api return a 404 error?