'Unable to use jsx files in react-native project

Get this issue when using react-native

npx react-native init AwesomeProject

enter image description here

OtherSample.jsx

enter image description here

Error thrown on the device

enter image description here

It works when its renamed from jsx to js is there something that needs to be configured before using the jsx files in react-native project?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source