typeerror cannot destructure property key of undefined or null
Where should I put