Next Js Typescript Array Methods In React