Closed Dalamar closed 4 years ago
It looks like you're not transpiling node_modules
(jsx is not being parsed properly). For ui-kitten
(or any React Native library actually) to work you need to make sure they get transpiled.
You'll have to add something like this in babel.config
file:
module: {
rules: [
// This would match almost any react-native module
{
test: /(@?react-(navigation|native)).*\.(ts|js)x?$/,
include: /node_modules/,
exclude: [/react-native-web/, /\.(native|ios|android)\.(ts|js)x?$/],
loader: 'babel-loader'
},
// This would match ui-kitten
{
test: /@?(ui-kitten|eva-design).*\.(ts|js)x?$/,
loader: 'babel-loader'
}
]
}
@lesmo thanks for supporting 🙏
If I add that I get the following error:
ERROR in ./src/App.tsx 29:2
Module parse failed: Unexpected token (29:2)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
|
| const HomeScreen = () => (
> <Layout style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>
| <Text category='h1'>HOME</Text>
| </Layout>
@ ./src/index.tsx 2:0-24 4:43-46
@lesmo Any idea? ty
I face same issues with vue js. Any recommendations? Please.
🐛 Bug Report
My app was build from TS template using installation guide in the docs.
npx react-native init MyApp --template @ui-kitten/template-ts
My app does not use expo.
My app has single screen with button and icon of facebook from the example in the docs. IconRegistry is configured according to the docs as well:
It works perfectly in iOS simulator.
On top of that I installed and added Web support via react-native-web package.
Compiling for web produces following error:
The only way to run web app is to remove IconRegistry and icon usage.
To Reproduce
Steps to reproduce the behavior: Install and setup react-native-web on top of the react-native-ui-kitten based app using eva-icons for the icons.
Expected behavior
Web app should compile without error in Web app.
Link to runnable example or repository (highly encouraged)
https://codesandbox.io/s/competent-currying-oh8wx
UI Kitten and Eva version
Environment information