ag-Grid Switch goes from checked to unchecked upon down sroll

Viewed 64

Getting this weird error where any checked material UI switch becomes unchecked as I scroll down out of that data view.

Below is the Switch return with conditional rendering.

 let freeTier = props.params.data.tier;

  return freeTier === "FREE" ? (
    <FormGroup>
      <FormControlLabel
        control={
          <Switch
            disableRipple
            focusVisibleClassName={classes.focusVisible}
            classes={{
              root: classes.root,
              switchBase: classes.switchBase,
              thumb: classes.thumb,
              track: classes.track,
              checked: classes.checked
            }}
            {...props}
          />
        }
      />
    </FormGroup>
  ) : null;

And this is where I call the above into cellRendererFramework

  cellRendererFramework: params => {
            const handleClick = params => {
              console.log(params.data);
            };

            return (
              <PaypalSwitch
                params={params}
                data={params.data}
                otherProps={this.props}
                onClick={() => handleClick(params)}
              />
            );
          }

From what it seems like the grid re-renders? I'm getting this error.

ag-Grid: React Component 'cellRendererFramework' not created within 1000ms

0 Answers
Related