Task Tracker (Web): TypeError: Cannot read properties of undefined (reading '0')

I am following the Task Tracker (Web) react tutorial and am getting this error and I cannot understand why I am getting it because I have followed everything as in the documentation. I am learning realm for the first time
:
E:/Web Dev/Realm/realm-tutorial-web/src/TaskApp.js:13
10 | console.log(app.currentUser.customData)
11 | const [currentProject, setCurrentProject] = React.useState(
12 | // set the current project as “My Project”

13 | app.currentUser.customData.memberOf[0]
| ^ 14 | );
15 | const [isEditingPermissions, setIsEditingPermissions] = React.useState(false);
16 | return (

link to the full question on stack overflow https://stackoverflow.com/questions/69403295/how-can-i-set-current-project-on-mongodb-realm-web-app-using-react-js