Comments (13)
临时解决方案:
修改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.
from react-native-root-toast.
For react-native >= 0.47 you can use [email protected], or using 1.2.1 for lower version.
from react-native-root-toast.
But How can I modify in native library??
from react-native-root-toast.
@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.
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.
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.
Is there any official fix for this?
from react-native-root-toast.
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.
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.
from react-native-root-toast.
@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.
Any proper solution found?
from react-native-root-toast.
Related Issues (20)
- Installation Error: unable to resolve dependency tree HOT 1
- ViewPropTypes warnings HOT 1
- invariant violation: ViewPropTypes has been removed from react native. migrate to ViewPropTypes exported from 'deprecated-react-native-prop-types'. HOT 1
- how to change toast style HOT 1
- latest npm version is set to 3.3.1 which was published after 3.4.0 HOT 4
- api方式怎么设置成一直显示
- 为什么toast 弹出了,还能操作下层的元素
- Library incompatibility
- Is it possible show multiple toast on the screen?
- Please update the following components: Toast HOT 5
- Orphaned "View" After Toast.show HOT 7
- In API mode, it will be covered below the pop-up layer in a Modal pop-up layer HOT 1
- _this._root.setNativeProps is not a function on react-native-web HOT 1
- _this._root.setNativeProps is not a function on react-native-web HOT 8
- Failed to find testID
- Doesn't work with latest Expo HOT 3
- 请求支持iOS新的隐私政策(2024年5月1号将强制执行) HOT 3
- Error: ViewPropTypes will be removed from React Native
- Can it support displaying only the toast at the same time
- List Multiple Toast Messages HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-root-toast.