magicismight / react-native-root-toast Goto Github PK
View Code? Open in Web Editor NEWreact native toast like component, pure javascript solution
License: MIT License
react native toast like component, pure javascript solution
License: MIT License
So related to #41, but more english in it.
root-toast
has a dependency: root-siblings
root-siblings
' version is not compatible with any higher React Native versions (I am currently on 0.45 for this to work)
I need to upgrade RN so that other dependencies behave properly, but in order to do that, I will have to wipe out root-toast entirely.
To install the latest version, i need to use this in my package.json
"@bam.tech/react-native-root-toast": "^1.3.1",
Why not just react-native-root-toast": "^1.3.1
???
Previous version does not work with react 16.0.0.
in ios react native is 0.46.1,when use this toast,the app get wrong。android is ok
刚刚升级到 2.1.0 报这个错,rn 版本是 0.46.4
Toast show will delay 2000ms when 'Debug Remote Js ' is Started in Android emulator
Toast.show('Hello Toast')
Any plans to upgrade to latest RN?
/Users/user/dir/node_modules/static-container/StaticContainer.js:1
({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,global,jest){import React, { Component, Children, PropTypes } from 'react';
^^^^^^
SyntaxError: Unexpected token import
at transformAndBuildScript (node_modules/jest-runtime/build/transform.js:320:12)
at Object.<anonymous> (node_modules/react-native-root-siblings/lib/AppRegistryInjection.js:3:22)
at Object.<anonymous> (node_modules/react-native-root-siblings/lib/SiblingsManager.js:3:27)
I find this error to be invoked by using package react-native-root-siblings which in new release is using static-container package which is not transformed with babel.
Quick fix is to install older version of package
npm install [email protected]
It used to work fine for NavigationExperimental, but it does not appear on react-navigation even if the visible prop is set to true
[email protected]
版本中使用了 ViewPropTypes, 在 0.43 版本及以下会导致 crash,建议做兼容或者直接升级到 2.x 版本。
查阅了官方源码,ViewPropTypes
这个东西是在 0.44 版本中添加的
兼容方案
import { View, ViewPropTypes as RNViewPropTypes } from 'react-native';
const ViewPropTypes = RNViewPropTypes || View.propTypes;
export default ViewPropTypes;
follow the README.md ,I use the first method to run , when click the button, I see a Toast, but I Quick click the button , Toasts are overlapping more . I can use the js to stop repeat, but i wish you can stop this in your plug-in.
const thisToastOnShow = true; //use a var record the Toast state
if(thisToastOnShow){
return;
}else{
return new RootSiblings(<ToastContainer
{...options}
visible={true}
>
{message}
</ToastContainer>);
}
First off, thanks for the great project + maintenance.
The project has a hideOnPress()
property, therefore user can interact with the toast. Can we expose the OnPress() so that we can add button(s) on the toast?
Usage would be:
User enters some invalid info, then toast would be:
you entered invalid info.
button: Reset
another button: Save Anyway
This warning gets logged in the console
Hi,
Thanks for your library, now there is a warning message in the console, the blog address
Hi,
I am using
expo sdk: v27.0.0
React Native: v0.55
react-native-root-toast: ^1.3.0
When I show Toast message and instantly redirect to the another screen then it is fall back to the first
default screen.
Can you please look into it?
react-native-root-siblings 在RN 0.48.1中存在不兼容
原因:
mocha使用babel register来编译项目的es2015+代码,但是babel默认不转译node_modules下面的库
解决方案:
最好按照其他node module的默认方式,上传的时候编译成es5.
can't have any children except <Text>
, <Image>
or raw string
positive and zero position is working as expected
Is there any config to adapter full-screen?
I set {position: 20}, But I don't know the unit of the number '20'. is it 'dp' or just 'px'?
In modals the toast appears in the modal back
Example
<Modal visible={true}>
<Toast visible={true} />
</Modal>
According to the stacktrace it is on line 71 of ToastContainer
.
Here's the raw stacktrace if that helps:
Warning: View.propTypes has been deprecated and will be removed in a future version of ReactNative. Use ViewPropTypes instead.
reactConsoleErrorHandler @ ExceptionsManager.js:71
printWarning @ warning.js:36
warning @ warning.js:60
get @ View.js:184
(anonymous) @ ToastContainer.js:71
loadModuleImplementation @ require.js:174
guardedLoadModule @ require.js:126
_require @ require.js:110
(anonymous) @ Toast.js:9
loadModuleImplementation @ require.js:174
guardedLoadModule @ require.js:126
_require @ require.js:110
(anonymous) @ index.js:1
loadModuleImplementation @ require.js:174
guardedLoadModule @ require.js:126
_require @ require.js:110
(anonymous) @ showToast.js:7
loadModuleImplementation @ require.js:174
guardedLoadModule @ require.js:126
_require @ require.js:110
(anonymous) @ auth.js:13
loadModuleImplementation @ require.js:174
guardedLoadModule @ require.js:126
_require @ require.js:110
(anonymous) @ distributor.js:1
loadModuleImplementation @ require.js:174
guardedLoadModule @ require.js:126
_require @ require.js:110
(anonymous) @ index.js:2
loadModuleImplementation @ require.js:174
guardedLoadModule @ require.js:126
_require @ require.js:110
(anonymous) @ configureStore.js:9
loadModuleImplementation @ require.js:174
guardedLoadModule @ require.js:126
_require @ require.js:110
(anonymous) @ main.js:6
loadModuleImplementation @ require.js:174
guardedLoadModule @ require.js:126
_require @ require.js:110
(anonymous) @ index.ios.js:8
loadModuleImplementation @ require.js:174
guardedLoadModule @ require.js:119
_require @ require.js:110
(anonymous) @ locale-sgzh.json:1
executeApplicationScript @ debuggerWorker.js:40
(anonymous) @ debuggerWorker.js:65
utils.js:240 [...effects] has been deprecated in favor of all([...effects]), please update your code
log @ utils.js:240
(anonymous) @ utils.js:246
runEffect @ proc.js:434
next @ proc.js:316
proc @ proc.js:271
runSaga @ runSaga.js:59
exports.default @ configureStore.js:26
(anonymous) @ main.js:26
loadModuleImplementation @ require.js:174
guardedLoadModule @ require.js:126
_require @ require.js:110
(anonymous) @ index.ios.js:8
loadModuleImplementation @ require.js:174
guardedLoadModule @ require.js:119
_require @ require.js:110
(anonymous) @ locale-sgzh.json:1
executeApplicationScript @ debuggerWorker.js:40
(anonymous) @ debuggerWorker.js:65
弹出框 显示的文字能改变它的字体的颜色和大小吗?
ANDROID
After a toast message is set and shown, if i press the home button to exit out and then go back to the app, the toast message reappears. Does this happen to anyone else?
It seems like componentWillUnmount never gets called.
I got this error on:
"react": "16.3.1",
"react-native": "0.55.3",
"react-native-root-toast": "^3.0.1",
And i found the error code at:
react-native-root-toast/lib/ToastContainer.js
The "Text" node can not has another child node:
render(){
...
<Text style={[
styles.textStyle,
props.textStyle,
props.textColor && {color: props.textColor}
]}>
{this.props.children}
</Text>
...
}
When I change the "Text" node to "View", My App works.
<View>
{this.props.children}
</View>
@magicismight 想实现的功能:根据请求返回的数据,toast中的文本是变化的
null is not an object(evaluting '_this._root_setNativeProps') ,当按下 回退键(android)的就会出现该错误。我的 RN 版本为 0.42
How can I change the default configuration?
When installing this component, it appears that the peer dependency (React Native root siblings) isn't downloaded. I'm using RN 0.23.0... Any idea?
Toaster messages appear behind modals, there is no z-index functionality to move them into the front.
Thanks for this project!
Is there a way to modify the toast to take up the full width of the screen and not just the content?
Toast should not just pop a text tip view, but also pop custom view like activity indicator. So if add this function, it would be funny.
toast弹出的时候,会被输入法对话框挡住
the error is: "Cannot read property 'visible' of undefined ", it doesn't work!
You can add styles to the toast container using containerStyle. Please update the read me
Thanks
/Users/dan/code/app/node_modules/react-native-root-siblings/index.js: /Users/dan/code/app/node_modules/react-native-root-siblings/index.js: Exporting local "_default", which is not declared. (This is an error on an internal node. Probably an internal error.)
Strange error since I do see the default export in the index.js
files...
export default class {
constructor(element, callback, store) {
const id = uuid++;
function update(element, callback, store) {
triggers.forEach(function (trigger) {
trigger(id, element, callback, store);
});
};
function destroy (callback) {
triggers.forEach(function (trigger) {
trigger(id, null, callback);
});
};
update(element, callback, store);
this.update = update;
this.destroy = destroy;
}
}
This is only happening on my production builds.
[email protected],[email protected] Report this error!At the same time, I want to know which version is used for 0.42.3?thank you!
在显示过程中,可否禁用用户点击下一层的按钮?
使用在,让用户等待过程,又不想让用户操作其他按钮。
Hi,
I installed "react-native-root-toast" and run the application. I got the error mentioned below:
ERROR: undefined is not an object (evaluating '_reactNative.ViewPropTypes.style')
I am newbie in React world. Please help me its appreciate me.
Thanks,
When keyboard is up and toast position is bottom, it's covered by keyboard! Is it possible to come upon keyboard view?
I like this pure javascript solution, however, why it requires "react-native-root-siblings"?
Furthermore, the "react-native-root-siblings" requires react-redux....
is this necessary?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.