Javascript 在时刻时间戳之前预加字符串

Javascript 在时刻时间戳之前预加字符串,javascript,reactjs,material-ui,momentjs,Javascript,Reactjs,Material Ui,Momentjs,我正在使用React和Material UI显示运行检查…,此时单击的状态为true。 否则,我将使用react moment显示时间戳 <Typography gutterBottom variant="caption"> {this.state.clicked ? "Running check..." : <Moment local format={dateFormat}>{lastCheckedDateTime}</Momen

我正在使用React和Material UI显示
运行检查…
,此时单击的
状态为
true
。 否则,我将使用
react moment
显示时间戳

 <Typography gutterBottom variant="caption">
   {this.state.clicked 
      ? "Running check..."
      : <Moment local format={dateFormat}>{lastCheckedDateTime}</Moment> }
 </Typography>

{this.state.clicked
“运行检查…”
:{lastCheckedDateTime}

如何使用字符串作为时间戳的前缀,如
上次选中:

不知道
组件呈现的时刻,但在其前面添加一个span或其他内容。如果力矩组件是块元素,则可能需要使用样式:


{this.state.clicked
“运行检查…”
: (
上次检查:
{lastCheckedDateTime}
)
}

不知道组件呈现的是什么时刻,但在它之前添加一个跨度或任何东西。如果力矩组件是块元素,则可能需要使用样式:


{this.state.clicked
“运行检查…”
: (
上次检查:
{lastCheckedDateTime}
)
}