Code Monkey home page Code Monkey logo

Comments (13)

xapm avatar xapm commented on July 29, 2024 5

临时解决方案:
修改node_modules/react-native-root-siblings/lib/AppRegistryInjection.js
将import EventEmitter from 'react-native/Libraries/EventEmitter/EventEmitter';
改为import EventEmitter from 'react-native/Libraries/vendor/emitter/EventEmitter';
备注:RN的这个版本移动了emitter包的位置

from react-native-root-toast.

Morriz avatar Morriz commented on July 29, 2024 4

from react-native-root-toast.

magicismight avatar magicismight commented on July 29, 2024 1

For react-native >= 0.47 you can use [email protected], or using 1.2.1 for lower version.

from react-native-root-toast.

bhatti-waqas avatar bhatti-waqas commented on July 29, 2024

But How can I modify in native library??

from react-native-root-toast.

Morriz avatar Morriz commented on July 29, 2024

@magicismight Please make your root siblings module work with RN 0.48+, so we don't have to fork your stuff and create confusion. It will also be the answer to this bug report :)

from react-native-root-toast.

kevando avatar kevando commented on July 29, 2024

For the non chinese folks like me, @zylibin solution worked for me:

Find the file node_modules/react-native-root-siblings/lib/AppRegistryInjection.js

And replace line: import EventEmitter from 'react-native/Libraries/EventEmitter/EventEmitter';
With import EventEmitter from 'react-native/Libraries/vendor/emitter/EventEmitter';

from react-native-root-toast.

beansoft avatar beansoft commented on July 29, 2024

please use my fork in your package.json, this might be the most easy solution, just a work around:

"react-native-root-toast": "github:pilipa-cn/react-native-root-toast#v2.2.0"

from react-native-root-toast.

Albinzr avatar Albinzr commented on July 29, 2024

Is there any official fix for this?

from react-native-root-toast.

Morriz avatar Morriz commented on July 29, 2024

No, like @beansoftapp offered, and what more people are doing, which leads to a lot of (unmaintained) forks: fork your own, or use somebody else's fork (like @beansoftapp's)

That is why, ultimately, most open source advocates will gently keep nudging the original maintainer to update the package. So pretty please @magicismight ?

from react-native-root-toast.

beansoft avatar beansoft commented on July 29, 2024

I totally agree with @Morriz, so i'd like to talk how to fix this issue without touch the original source code at all. This bug occured as the author has specific the dependencies like this:

"dependencies": {
        "react-native-root-siblings": "^1.2.1"
    }

so the ^ will not lock the version of react-native-root-siblings, but the author released another new version of react-native-root-siblings which only works on latest react native. If you are using RN 0.46 ~ 0.48, you can run yarn first, then edit the yarn.lock file, and commit this file to your code base and other team member will using the same version as you, they just need do run a yarn. Now search and edit version number to this:

react-native-root-siblings@^1.2.1:
  version "1.2.1"
  resolved "https://registry.yarnpkg.com/react-native-root-siblings/-/react-native-root-siblings-1.2.1.tgz#6f8d0e711dbf9aef4e57e73aea751372b5aefcff"
  dependencies:
    static-container "^1.0.0"

react-native-root-toast@^1.1.2:
  version "1.1.2"
  resolved "https://registry.yarnpkg.com/react-native-root-toast/-/react-native-root-toast-1.1.2.tgz#1f5a2dad70743a9ab6b5d44674c8dda578523961"
  dependencies:
    react-native-root-siblings "^1.2.1"

in package.json:
"react-native-root-toast": "1.1.2"
Then you must run yarn again, this will make sure your local node_modules using the correct version.

from react-native-root-toast.

Morriz avatar Morriz commented on July 29, 2024

from react-native-root-toast.

beansoft avatar beansoft commented on July 29, 2024

@magicismight so it might be kindly enough for you to add supported RN version range in the readme file. In fact this issue was first found after Nov 25, our CI breaks nightly build, after that I added yarn.lock file to our code base.

from react-native-root-toast.

asnad avatar asnad commented on July 29, 2024

Any proper solution found?

from react-native-root-toast.

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.