I have
Parsing erros: Unexpected token, expected ","
in the project I code in codesandbox.io. I have just connected codesandbox project into github repository and it throws such error which I cannot figure-out. Can You please suggest what is wrong and how to fix it?
Please don't post screenshots of code. It's usually actually faster to just copy-paste in your code, and you can use three backticks both above and below the code to format it correctly.
Trust your error messages to point you in the right direction: it's telling you that your exclamation mark is invalid. The
!
is a non-null assertion operator, it doesn't belong there because you're not accessing a property that TS might think is null. The parser thinks you meant to do something like(rootElement, !someOtherThing)
, hence the error saying it expected a comma.