react-native-toast-message 2.0.0-beta.2 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -9,6 +9,84 @@ Headers are one of:
9
9
 
10
10
  - `Added`, `Changed`, `Removed`, `Fixed` or `Breaking`.
11
11
 
12
+ ## [2.0.0]
13
+
14
+ ### Breaking
15
+
16
+ - Setting the `ref` is no longer required when rendering the `Toast` component in your app's entry point. Ref storage is now handled internally using [React.createRef](https://reactjs.org/docs/react-api.html#reactcreateref). This should improve ref access reliability at runtime.
17
+
18
+ ```js
19
+ // App.jsx
20
+ import Toast from 'react-native-toast-message';
21
+
22
+ export function App(props) {
23
+ return (
24
+ <>
25
+ {/* ... */}
26
+ <Toast />
27
+ </>
28
+ );
29
+ }
30
+ ```
31
+
32
+ - When you want to have the Toast visible inside a Modal, you no longer need to set a separate `ref`.
33
+
34
+ Simply render the `Toast` component inside the Modal, as well as in your app's entry point. When the Modal is visible, the `ref` from inside the Modal will be automatically used.
35
+
36
+ - `onHide` callback is now always called when the Toast hides (does not matter if `autoHide` was `true` / `false`).
37
+
38
+ - `inProgress` state has been removed and can no longer be relied upon in a custom Toast config.
39
+
40
+ - `style` and `height` props from the Toast component were removed; with the purpose of achieving a cleaner API design. The only way to change the style / layout of different Toast types is through the `config` prop (fixes [#204](https://github.com/calintamas/react-native-toast-message/issues/204)).
41
+
42
+ ### Added
43
+
44
+ - on the `BaseToast` component, the following props were added: `touchableContainerProps`, `contentContainerProps`, `text1Props`, `text2Props` , `text1NumberOfLines`, `text2NumberOfLines` (fixes [#112](https://github.com/calintamas/react-native-toast-message/issues/112), [#133](https://github.com/calintamas/react-native-toast-message/issues/133)).
45
+
46
+ - on the `Toast` component, the following callbacks were added as props: `onShow` , `onHide` and `onPress` (fixes [#143](https://github.com/calintamas/react-native-toast-message/issues/143)).
47
+
48
+ - A new `ToastShowParams` type is exported (fixes [#192](https://github.com/calintamas/react-native-toast-message/issues/192)).
49
+
50
+ ### Changed
51
+
52
+ - `topOffset` and `bottomOffset` are now by default `40px`
53
+ - New test ids on `BaseToast` component: `toastTouchableContainer`, `toastContentContainer`, `toastText1` and `toastText2`.
54
+
55
+ ### Removed
56
+
57
+ - Success, error and info leading icons were removed from the package (to make it as lightweight as possible).
58
+
59
+ It's now possible to pass them via render functions (for more flexibility, see issues regarding svg support, using components as icons, etc) on `BaseToast` component, example below:
60
+
61
+ ```js
62
+ const toastConfig = {
63
+ success: (props) => (
64
+ <BaseToast
65
+ {...props}
66
+ renderLeadingIcon={() => <Image />}
67
+ renderTrailingIcon={() => <Image />}
68
+ />
69
+ )
70
+ }
71
+ ```
72
+
73
+ Fixes [#188](https://github.com/calintamas/react-native-toast-message/issues/188), [#203](https://github.com/calintamas/react-native-toast-message/issues/203), [#245](https://github.com/calintamas/react-native-toast-message/issues/245), [#250](https://github.com/calintamas/react-native-toast-message/issues/250).
74
+
75
+ - Trailing close icon has been removed from default components `BaseToast`, `SuccessToast`, `ErrorToast` and `InfoToast`. Fixes [#167](https://github.com/calintamas/react-native-toast-message/issues/167).
76
+
77
+ ### Fixed
78
+
79
+ - Failed prop type: Invalid props.text2Style key fontSize supplied to BaseToast [#174](https://github.com/calintamas/react-native-toast-message/issues/174).
80
+ - Changing Font Family does not work [#176](https://github.com/calintamas/react-native-toast-message/issues/176)
81
+ - Text1 not showing on Android [#194](https://github.com/calintamas/react-native-toast-message/issues/194)
82
+ - Toast background is Transparent [#219](https://github.com/calintamas/react-native-toast-message/issues/219)
83
+ - TypeError: Cannot read property 'show' of null [#232](https://github.com/calintamas/react-native-toast-message/issues/232)
84
+ - textStyle1 styles not been applied [#233](https://github.com/calintamas/react-native-toast-message/issues/233)
85
+ - Typescript-class component toast message in modal usage [#172](https://github.com/calintamas/react-native-toast-message/issues/172)
86
+ - Getting last toast along with native prompt [#149](https://github.com/calintamas/react-native-toast-message/issues/149)
87
+ - When modal request permission appear then the modal toast on the previous screen also appears -> android [#226](https://github.com/calintamas/react-native-toast-message/issues/226)
88
+ - autoHide: false crashes on android [#256](https://github.com/calintamas/react-native-toast-message/issues/256)
89
+
12
90
  ## [1.6.0]
13
91
 
14
92
  ### Added
package/README.md CHANGED
@@ -20,6 +20,8 @@ Animated toast message component for React Native.
20
20
 
21
21
  ## Documentation
22
22
 
23
+ > This is the documentation for `react-native-toast-message@v2`, which has a similar API to v1, but contains a few important changes. [Read the complete changelog](./CHANGELOG.md#200).
24
+
23
25
  - [Quick start](./docs/quick-start.md)
24
26
  - [API](./docs/api.md)
25
27
  - [Create custom layouts](./docs/custom-layouts.md)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-toast-message",
3
- "version": "2.0.0-beta.2",
3
+ "version": "2.0.0",
4
4
  "description": "Toast message component for React Native",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./lib/index.d.ts",