vercel / next.js

The React Framework
https://nextjs.org
MIT License
124.96k stars 26.69k forks source link

NativeBase integration? #7450

Closed stan-sack closed 5 years ago

stan-sack commented 5 years ago

Has anyone been able to use next.js with NativeBase UI Kit? I've been following the documentation here and I am attempting to implement their webpack overrides by setting up my next.config.js as follows:

const path = require("path");

module.exports = {
    webpack: (config, { buildId, dev, isServer, defaultLoaders, webpack }) => {
        config.resolve.alias = {
            ...(config.resolve.alias || {}),
            "react-native": "react-native-web",
            "react-native/Libraries/Renderer/shims/ReactNativePropRegistry":
                "react-native-web/dist/modules/ReactNativePropRegistry"
        };

        config.module.rules.unshift({
            test: /\.(js|mjs|jsx)$/,
            use: [
                {
                    loader: defaultLoaders.babel.loader,
                    options: {
                        ...defaultLoaders.babel.options,
                        plugins: [
                          "@babel/plugin-proposal-class-properties",
                          "@babel/plugin-transform-flow-comments"
                        ]
                    }
                }
            ],
            include: [
                path.resolve("node_modules/native-base-shoutem-theme"),
                path.resolve("node_modules/react-navigation"),
                path.resolve("node_modules/react-native-easy-grid"),
                path.resolve("node_modules/react-native-drawer"),
                path.resolve("node_modules/react-native-safe-area-view"),
                path.resolve("node_modules/react-native-vector-icons"),
                path.resolve("node_modules/react-native-keyboard-aware-scroll-view"),
                path.resolve("node_modules/react-native-web"),
                path.resolve("node_modules/react-native-tab-view"),
                path.resolve("node_modules/static-container")
            ]
        });

        return config;
    }
};

But I am getting the error:

<BASE_DIR>/node_modules/native-base-shoutem-theme/index.js:1
import connectStyle from "./src/connectStyle";
       ^^^^^^^^^^^^
SyntaxError: Unexpected identifier

If anyone has been able to do this or has any idea on how to fix this error I'd really appreciate the help.

timneutkens commented 5 years ago

Please follow the issue template.

balazsorban44 commented 2 years ago

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.