Uncaught TypeError: (intermediate value).concat is not a function

Viewed 927

I'm developing a react project, I used Material UI and for pagination, I should pass rowsPerPageOptions as props with an array value, But I wanna this array doesn't have duplicated item, so I decide to create a Set and then convert it to an array, so I wrote below code:

<TablePagination
  ~~~
  rowsPerPageOptions={[...new Set([1, 2, 3, 4, 4, 5, 5])]}
  ~~~
/>

And I got the following error:

Uncaught TypeError: (intermediate value).concat is not a function

When I use Array.from everything works well, but why spread operator of ES6 doesn't work?

enter image description here

0 Answers
Related