Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6287

React native snack expo typescript error Parsing error: Unexpected token, expected ","

$
0
0

enter image description here

I don't understand what the problem is, if I remove the readonly it seems that the error message disappears.

How come you give the following message?

Link: expo

function areInputsEqual(  newInputs: readonly unknown[],  lastInputs: readonly unknown[]): boolean {  // Using for loop for speed. It generally performs better than array.every  // https://github.com/alexreardon/memoize-one/pull/59  for (let i = 0; i < newInputs.length; i++) {    // using shallow equality check    if (newInputs[i] !== lastInputs[i]) {      return false;    }  }  return true;}let lastArgs: unknown[] = [];let lastResult = 0;export default function mergeExtraData(...newArgs: unknown[]): number {  if (areInputsEqual(newArgs, lastArgs)) {    return lastResult;  }  // Something shallowly changed - return a new number from [0-10]  lastResult = lastResult === 10 ? 0 : lastResult + 1;  lastArgs = newArgs;  return lastResult;}

Viewing all articles
Browse latest Browse all 6287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>