./ SRC /组件/首次标签机/播放机-setup.jsx
模块构建失败:SyntaxError:C:/workspace/fasg-sports-dashboard/src/components/first-time-tab/player-setup.jsx:意外的令牌(11:16)
9 | renderAccountTabContent() {
10 | return (
> 11 | let sportsStartDate = this.props.playerInfo.sportsStartDate;
答案 0 :(得分:1)
在您的错误中,它显示您尝试return
变量赋值,而不是代码。把这一行放在回报之外。
试试这个......
renderAccountTabContent() {
let sportsStartDate = this.props.playerInfo.sportsStartDate;
let renderData;
let now = moment().format('YYYY-MM-DD');
let past1Days = moment().subtract(1, 'days').format('YYYY-MM-DD');
let past2Days = moment().subtract(2, 'days').format('YYYY-MM-DD');
let past3Days = moment().subtract(3, 'days').format('YYYY-MM-DD');
if(sportsStartDate && sportsStartDate === now) {
renderData = 'We’re setting up your player and verifying the funds you’ve deposited. Don’t worry — it might take a couple of days for your player to reflect your balance.';
} else if(sportsStartDate && sportsStartDate === past1Days) {
renderData = "We’re setting up your player and verifying the funds you’ve deposited. Don’t worry — it might take a couple of days for your player to reflect your balance.";
} else if(sportsStartDate && sportsStartDate === past2Days) {
renderData = "We’re making some progress. See what’s happening today.";
} else if(sportsStartDate && sportsStartDate === past3Days) {
renderData = "We’ve put your money to work in your investment player.See what’s happening today.";
} else {
renderData = "Your new portfolio is a work in progress. See what’s happening today.";
}
return (
renderData
);
}