react-native-toast-message
react-native-toast-message copied to clipboard
text1NumberOfLines props not working
text1NumberOfLines props not working , it always shows 1 only line
i'm also facing this issue, i tried below still not working
const toastConfig = { info: (props) => ( <BaseToast {...props} style={{ height: 100 }} contentContainerStyle={{}} text2Style={{ numberOfLines: 2, }} /> ), };
Hi! 👋
Firstly, thanks for your work on this project! 🙂
Today I used patch-package to patch [email protected] for the project I'm working on.
Here is the diff that solved my problem:
diff --git a/node_modules/react-native-toast-message/lib/src/components/BaseToast.styles.js b/node_modules/react-native-toast-message/lib/src/components/BaseToast.styles.js
index 105748b..5440cea 100644
--- a/node_modules/react-native-toast-message/lib/src/components/BaseToast.styles.js
+++ b/node_modules/react-native-toast-message/lib/src/components/BaseToast.styles.js
@@ -5,7 +5,7 @@ export const BORDER_RADIUS = 6;
export const styles = StyleSheet.create({
base: {
flexDirection: 'row',
- height: HEIGHT,
+ minHeight: HEIGHT,
width: WIDTH,
borderRadius: BORDER_RADIUS,
shadowOffset: { width: 0, height: 0 },
Hi, to me it wasn't enough using @jimkhan's approach. Besides changing the height to minHeight, I also changed had to change the following file node_modules/react-native-toast-message/lib/src/components/BaseToast.js:
- from default value
text1NumberOfLines = 1totext1NumberOfLines = 5 - removed the setter for the
ellipsizeMode='tail'property.
Hope it helps 👍
I found it works to use text1NumberOfLines = 0 like the docs said, then it wraps perfectly for me.
This is still not fixed