Trying to log object keeps returning undefined

Viewed 19

So I have this custom type:

export default interface ObjectType {
  size?: number,
  title: string,
  max: number 
}

Then I want to inject the above into another custom type,

import ObjectType from 'types/objectName'
export interface NavProps { object?: ObjectType }

Then I want to pass the NavProps into my NavComponent to render. So just to make sure things are working I made a small function in my NavComponent file. With NavProps being imported as well

export default function NavComponent({object}: NavProps){
    console.log({object})
}

I just wanted to console the object so I can see if its properties are passing, but I keep getting undefined. Can anyone assist and explain why this doesnt work? The project is built with Next/React using typescript. Apologies for the format, my cpu died and Im on my phone.

0 Answers
Related