unexpected syntax after working with such syntax for sometimes now nullish coalescing in react.js

371 views Asked by At

Failed to compile.

Error in ./src/View.js Syntax error: C:/workspace/reactsapp/my-shop/src/View.js: Unexpected token (77:69)

  75 |     const [mainImage, setMainImage] = useState(product);
  76 |     const [orderQuantity, setQuantity] = useState(setOrderQuantity());
> 77 |     const [orderedProduct, setOrderProduct] = useState(getStorage() ?? [])
     |                                                                      ^
  78 |     const [headerKey, setHeaderKey] = useState(Math.random())
  79 |     useEffect(async () => {
  80 |         // setQuantity(3)

@ ./src/index.js 17:12-29

Why getting this error after working with such syntax for a long now.

you can see the previous working commit at https://github.com/codad5/wemall-frontend/commit/709dd9bf1ed598ffdeef706e9191509d870acdc7

the GitHub link https://github.com/codad5/wemall-frontend/

although I haven't committed this current code with this bug

I am running on node version v17.4.0

0

There are 0 answers