react-native-fast-toast
Advanced tools
Comparing version 1.0.4 to 1.0.5
{ | ||
"name": "react-native-fast-toast", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"main": "index.ts", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -47,2 +47,3 @@ # react-native-fast-toast | ||
## Global Example | ||
If you want to have one Toast and use it everywhere on your app. do this in root component of your app (index.js or App.js) | ||
@@ -61,2 +62,3 @@ | ||
global['toast'] = toast.current | ||
}, []); | ||
@@ -71,8 +73,11 @@ | ||
``` | ||
now you can call ```toast.show()``` everywhere on app. like alert. | ||
now you can call `toast.show()` everywhere on app. like alert. | ||
Check [index.d.ts](/example/index.d.ts) in example app for typescript. | ||
## Type Example | ||
```js | ||
toast.current.show('Task finished successfully', { type: 'success' }) | ||
toast.current.show("Task finished successfully", { type: "success" }); | ||
``` | ||
@@ -83,3 +88,3 @@ | ||
```js | ||
toast.current.show('Task finished successfully', { icon: <Icon /> }) | ||
toast.current.show("Task finished successfully", { icon: <Icon /> }); | ||
``` | ||
@@ -103,8 +108,7 @@ | ||
```js | ||
toast.current.show('Task finished successfully', { | ||
duration: 5000, | ||
style: { padding: 0 }, | ||
textStyle: { fontSize: 20 } | ||
}) | ||
toast.current.show("Task finished successfully", { | ||
duration: 5000, | ||
style: { padding: 0 }, | ||
textStyle: { fontSize: 20 }, | ||
}); | ||
``` | ||
@@ -123,2 +127,1 @@ | ||
While developing, you can run the [example app](/example) to test your changes. | ||
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7398
199
122