Loader reference to handle the react error

44 views Asked by At

When i try implementing the following code

const handleClick = (click) => {
  let result = {};
  const output = Object.keys(value)?.map((ele) => {
    if (ele === click) result[ele] = true;
    else result[ele] = false;
  });
  setValue(result);
};

getting this error. Please help me with it.

1

There are 1 answers

4
Zachiah On BEST ANSWER

As the Optional Chaining operator is very new a lot of tooling doesn't support it. I would suggest updating your node version as well as running npm update. You also might need to update your babel config to support the syntax.