You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make sure that jsx property is set to react-native in Typescript's compilerOptions
I am trying to setup a react-native-web project with typescript support. Have been using jsx option 'react' as recommended in pretty much all the sample code I have been reading. On switching to 'react-native', module parser throws errors like these:
ERROR in ../src/index.tsx 10:12
Module parse failed: Unexpected token (10:12)
File was processed with these loaders:
../node_modules/ts-loader/index.js
You may need an additional loader to handle the result of these loaders.
| const { height } = react_native_1.Dimensions.get('screen');
| const App = () => {
return (<react_native_1.View>
| <react_native_1.View>
| <react_native_1.Text>hello</react_native_1.Text>
@ ../index.web.tsx 8:30-46
Is there a way to support 'react'? Or an example of react-native-web setup that uses jsx option of 'react-native' with css-loader? I am using the following versions:
From the typescript setup docs:
I am trying to setup a react-native-web project with typescript support. Have been using jsx option 'react' as recommended in pretty much all the sample code I have been reading. On switching to 'react-native', module parser throws errors like these:
Is there a way to support 'react'? Or an example of react-native-web setup that uses jsx option of 'react-native' with css-loader? I am using the following versions:
"react-native": "0.61.5",
"react-native-web": "^0.11.7",
"typescript": "^3.7.4",
"css-loader": "^3.4.0"
The text was updated successfully, but these errors were encountered: