Home > Back-end >  Uncaught TypeError: gridElement.style.setProerty is not a function
Uncaught TypeError: gridElement.style.setProerty is not a function

Time:04-19

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`);
  }
}

CodePudding user response:

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

  • Related