Uncaught TypeError: gridElement.style.setProerty is not a function

390 views Asked by At

I'm trying to set the style properties but I'm facing the following JS Error Uncaught TypeError: gridElement.style.setProerty is not a function

const CELL_GAP = 2;
const CELL_SIZE = 20;
const GRID_SIZE = 4;

export default class Grid {
  constructor(gridElement) {
    gridElement.style.setProerty("--grid-size", GRID_SIZE);
    gridElement.style.setProerty("--cell-gap", `${CELL_GAP}vmin`);
    gridElement.style.setProerty("--cell-size", `${CELL_SIZE}vmin`);
  }
}
1

There are 1 answers

0
Amats On BEST ANSWER

Looks like you have a typo. Change setProerty to setProperty and you should be good to go.