akveo / akveo/react-native-ui-kitten

Use kitten-ui with nextjs and createExpoWebpackConfigAsync

未關閉
#1,557 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
TypeScript
星號
10.7k
分支
962
PR 合併指標
30 天內沒有已合併 PR

描述

## 💬 Question

If you want to use kitten-ui with react-native-web you currently have to [update your webpack.config like this](https://github.com/akveo/react-native-ui-kitten/issues/1535#issuecomment-944876518):

```js
const createExpoWebpackConfigAsync = require('@expo/webpack-config');

module.exports = async function(env, argv) {
const config = await createExpoWebpackConfigAsync({
...env,
babel: {
dangerouslyAddModulePathsToTranspile: ['@ui-kitten/components']
}
}, argv);
return config;
};
```

Unfortunately, nextjs has its own `next.config.js`, such as:

```js
const withPlugins = require('next-compose-plugins');
const { withExpo } = require('@expo/next-adapter');
const withTM = require('next-transpile-modules')([
'@ui-kitten/components',
]);

module.exports = withPlugins(
[
[withExpo, { projectRoot: __dirname }],
withTM({
webpack: (config, options) => {
config.experiments = {
...config.experiments,
topLevelAwait: true,
};
return config;
},
}),
],
)

```

The problem here is, you [cant use a promise](https://nextjs.org/docs/messages/promise-in-next-config) which you need for `createExpoWebpackConfigAsync`.

Anyone has a fix?

## UI Kitten and Eva version

"@eva-design/eva: "^2.1.1",
"ui-kitten/components": "^5.1.1",
"next": "^11.1.2",
"next-compose-plugins": "^2.2.1",
"next-transpile-modules": "^9.0.0",

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。