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

Array.at method not working in React-Native Release and debug(not on browser debuger) builds

$
0
0

I am using react-native (0.68.1) with typescript and unable to use the new Array.at() method in my app as it throws the following error.

Although it does seem to work when using chrome debugger. I understand that the issue is the method being fairly new and not present in the javascript version packaged in the build.But my question is, why it is not polyfilled/tranformed by typescipt into a supported syntax? my understanding is that typescript during transpilation replaces non supported features of target javascript version with polyfills.

simulator screenshot iphone 13 iOS 15.0

The following is my typescript config.

    {"compilerOptions": {"allowJs": true,"allowSyntheticDefaultImports": true,"esModuleInterop": true,"isolatedModules": true,"jsx": "react-native","lib": ["es2017"],"moduleResolution": "node","noEmit": true,"strict": true,"target": "esnext","resolveJsonModule": true /* Allows importing modules with a ‘.json’ extension, which is a common practice in node projects. */  },"exclude": ["node_modules","babel.config.js","metro.config.js","jest.config.js"  ]}

Viewing all articles
Browse latest Browse all 6287

Trending Articles



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