Issue
next.js npm run dev keeps failing with this optional property in tsx file:
Syntax error: Unexpected token
44 |
45 | type State<T_HT> = {
> 46 | ghostHighlight: ?{
| ^
47 | position: T_ScaledPosition
48 | },
49 | isCollapsed: boolean,
what causes this, how to resolve this
Solution
Optional properties, question mark should come before colon as below
ghostHighlight ?: {
position: T_ScaledPosition
}
Answered By - Isaac
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.