Can you tell what’s wrong with the following code (my eyes are broken)?
class Numbers extends React.Component {
const arrayOfNumbers = _.range(1, 10);
}
So I put your code in there https://www.typescriptlang.org
And it says A class member cannot have the 'const' keyword.
I think that the issue with your code is that you try to make a class member constant by adding the const
keyword.
But a class member cannot have the 'const' keyword. (link found with this amazing tool)