Reactjs 如何在FullCalendar的react js中附加和显示具有其他属性的标题?

Reactjs 如何在FullCalendar的react js中附加和显示具有其他属性的标题?,reactjs,fullcalendar,title,Reactjs,Fullcalendar,Title,我想用同一事件的名字和姓氏来描述这个标题 因此,活动标题显示为“夜班:热汗拜” 以下是我的活动: { "_id": "5f607e0cc8ec5321c84f8a2d", "userId": { "_id": "5f5c8a7fcb2f483bf0f45062", "username": "

我想用同一事件的名字和姓氏来描述这个标题 因此,活动标题显示为“夜班:热汗拜”

以下是我的活动:

{
        "_id": "5f607e0cc8ec5321c84f8a2d",
        "userId": {
            "_id": "5f5c8a7fcb2f483bf0f45062",
            "username": "Rehan Bhai",
            "firstName": "Rehan",
            "lastName": "Bhai",
            "email": "rehanuser@gmail.com",
            "partener": "yes",
            "type": "user",
            "pass": "$2a$10$zVT1vnJE6nhPq36hk1OJPuwBAxiqenP0sOt5LowdLFPNfqhUy2ZDi",
            "avatar": "//www.gravatar.com/avatar/8092a3d2de82f15929882914c7ad7781?s=200&r=pg&d=mm",
            "regDate": "2020-09-12",
            "__v": 0
        },
        "start": "2020-09-08",
        "end": "2020-09-08",
        "title": "Evening Shift",
        "color": "#25d818",
        "__v": 0
}
以下是我的代码:

<FullCalendar
    defaultView="dayGridMonth"
    plugins={[dayGridPlugin, interactionPlugin]}
  events={events}
  />

试着像这样分解它

<FullCalendar
  defaultView="dayGridMonth"
  plugins={[dayGridPlugin, interactionPlugin]}
  events={events.map((event) => {
    return {
      id: event._id,
      userId: event.userId,
      start: event.start,
      end: event.end,
      title: `${event.title}: ${event.userId.firstName} ${event.userId.lastName}`,
    };
  })}
/>;
{
返回{
id:event.\u id,
userId:event.userId,
开始:event.start,
结束:event.end,
标题:`${event.title}:${event.userId.firstName}${event.userId.lastName}`,
};
})}
/>;