Optional chaining can be really useful to help with potential errors when accessing a property of an object. It allows you to access a property deep within an object without risking an error if one of the properties is nullish (null or undefined).
To keep track of the state, we need to use the useState hook with an initial value. The initial value will typically be the data type you will be using. In this case we are using an empty array to declare the initial value.