mardi 21 août 2018

ReactJS - Module build failed: SyntaxError: Unexpected token

I am building an application in ReactJS in which I need to add some code from https://github.com/mui-org/material-ui/issues/5750#issuecomment-381901102

When my webpack run it gives an error below

ERROR in ./src/components/dashboard/DashboardBase.js Module build failed: SyntaxError: Unexpected token, expected , (37:19)

  35 |     let clientY: number | null = null; // remember Y position on touch start
  36 |     const touchStart: (event: Event) => void = (event: Event) => {
> 37 |         if ((event as TouchEvent).targetTouches.length === 1) {
     |                    ^
  38 |             clientY = (event as TouchEvent).targetTouches[0].clientY;
  39 |         }
  40 |     };

Please help me over this issue. May I did some silly mistake or miss something. Please let me know.

Aucun commentaire:

Enregistrer un commentaire