简体   繁体   English

期望一个赋值或函数调用,而是在定义接口时看到一个表达式

[英]Expected an assignment or function call and instead saw an expression when defining interface

Im trying to build a form and start by defining an interface我试图构建一个表单并从定义一个接口开始

 interface TokenListProps { readonly contractAddress: string; }

and I get a compile error 'Expected an assignment or function call and instead saw an expression' for this line.并且我收到此行的编译错误“预期分配或函数调用,而是看到了一个表达式”。

Any suggestions on why this might be?关于为什么会这样的任何建议?

Based upon the info you have provided the issue is the newlines in your definitions.根据您提供的信息,问题是您定义中的换行符。

You currently have this:你目前有这个:

interface
TokenListProps
{
  readonly
  contractAddress: string;
}

And it should be like this:它应该是这样的:

interface TokenListProps
{
  readonly contractAddress: string;
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 期望赋值或函数调用,而是看到了一个表达式 - Expected an assignment or function call and instead saw an expression 期望一个赋值或函数调用,而是看到一个表达式? - Expected an assignment or function call and instead saw an expression? 期望一个赋值或函数调用,而是看到一个表达式 - Expected an assignment or function call and instead saw an expression return function returning预期的赋值或函数调用,而是看到一个表达式 - return function returning Expected an assignment or function call and instead saw an expression 期望赋值或函数调用,但在函数中看到表达式错误 - Expected an assignment or function call and instead saw an expression error in function Javascript:JSHint:需要一个赋值或函数调用,而是看到一个表达式 - Javascript: JSHint: Expected an assignment or function call and instead saw an expression 错误-预期分配或函数调用,而是看到一个表达式 - Error - Expected an assignment or function call and instead saw an expression ReactJS错误:“预期分配或函数调用,而是看到了一个表达式” - ReactJS error: “Expected an assignment or function call and instead saw an expression” 警告带有主干的JSHint:预期分配或函数调用,而是看到一个表达式 - Warning JSHint with backbone : Expected an assignment or function call and instead saw an expression 错误:预期分配或函数调用,而是看到一个表达式 - Error: expected an assignment or function call and instead saw an expression
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM