Coder Social home page Coder Social logo

Comments (7)

dai-shi avatar dai-shi commented on August 21, 2024 1

https://www.npmjs.com/package/use-context-selector/v/1.4.1

from use-context-selector.

sf185127 avatar sf185127 commented on August 21, 2024

+1 . I've downgraded to 1.3.10 as a workaround for now (after needing to upgrade due to the react 18 children change)

from use-context-selector.

lightrow avatar lightrow commented on August 21, 2024

temporary fix
metro.config.js

const defaultSourceExts = require('metro-config/src/defaults/defaults').sourceExts;
const defaultResolver = require('metro-resolver').resolve;

module.exports = {
    transformer: {
        getTransformOptions: async () => ({
            transform: {
                experimentalImportSupport: false,
                inlineRequires: true,
            },
        }),
    },
    resolver: {
        sourceExts: process.env.RN_SRC_EXT
            ? [...process.env.RN_SRC_EXT.split(',').concat(defaultSourceExts), 'mjs']
            : [...defaultSourceExts, 'mjs'],
        resolveRequest: (context, moduleName, platform, realModuleName) => {
            if (moduleName.includes('use-context-selector')) {
                // https://github.com/dai-shi/use-context-selector/issues/82

                return {
                    filePath: path.join(__dirname, './node_modules/use-context-selector/dist/index.native.modern.mjs'),
                    type: 'sourceFile',
                };
            }
            return defaultResolver(
                {
                    ...context,
                    resolveRequest: null,
                },
                moduleName,
                platform,
                realModuleName,
            );
        },
    },
};

from use-context-selector.

dai-shi avatar dai-shi commented on August 21, 2024

😱 I broke it in a commit... d063fb2
Thanks for reporting!!!

from use-context-selector.

dai-shi avatar dai-shi commented on August 21, 2024

Please try #83 and see if the issue is resolved.
https://ci.codesandbox.io/status/dai-shi/use-context-selector/pr/83
Find "Local Install Instructions" in ☝️ .

from use-context-selector.

sf185127 avatar sf185127 commented on August 21, 2024

@dai-shi just tested this in my app, it works great. 👍

from use-context-selector.

dai-shi avatar dai-shi commented on August 21, 2024

@sf185127 Thanks for confirming!

from use-context-selector.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.