How To Convert Object Into Array In Typescript Vs React