Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

94
Views
Maximum update depth exceeded React when using Grommet Chart component

I am getting the following error:

Uncaught Error: Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.

Followed by:

The above error occurred in the "Chart" component

my only use of the Chart component (which is from the grommet compontent lib) comes from this bit of code:

import {Chart} from 'grommet';


const WaveForm = (props:any):JSX.Element => { 
    
    const size= props.waveForm.length
    const color = props.isRecording?"recording":props.isPrimed?"primed":"brand";   

    return (
            <Chart
            bounds={[[0,Math.max(1000,size)], [-25,25]]}
            values= {props.waveForm.map((e:number,i:number) => ({value:[i, e, -e]}))}
            size={{"width": "fill",height:"75%"}} 
            round={true}
            color={color}
            thickness="hair"
            />
    
    );
  }

export default WaveForm;

I cannot for the life of me see why this is causing endless re-renders. Any help would be greatly appreciated.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

The issue seemed to be due to an issue with the Grommet Chart handles 'fill'. Changing

size={{"width": "fill",height:"75%"}}

to

size={{"width": "100%",height:"75%"}}

fixed the issue

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!