55 useToast ,
66 type ToastComponentProps ,
77} from 'heroui-native' ;
8+ import { useCallback } from 'react' ;
89import { View } from 'react-native' ;
910import type { UsageVariant } from '../../../components/component-presentation/types' ;
1011import { UsageVariantFlatList } from '../../../components/component-presentation/usage-variant-flatlist' ;
@@ -76,15 +77,17 @@ import { UsageVariantFlatList } from '../../../components/component-presentation
7677
7778const MyToast1 = ( props : ToastComponentProps ) => {
7879 const { id, hide } = props ;
80+ console . log ( '🔴 id 🔴' , id ) ; // VS remove
7981
8082 return (
8183 < Toast
8284 variant = "accent"
85+ placement = "top"
8386 duration = "persistent"
8487 className = "flex-row items-center gap-3"
8588 { ...props }
8689 >
87- < View className = "flex-1 h-[150px] " >
90+ < View className = "flex-1" >
8891 < Toast . Label > { id } </ Toast . Label >
8992 < Toast . Description >
9093 Use buttons below to control this toast
@@ -97,18 +100,22 @@ const MyToast1 = (props: ToastComponentProps) => {
97100
98101const MyToast2 = ( props : ToastComponentProps ) => {
99102 const { id, hide } = props ;
103+ console . log ( '🔴 id 🔴' , id ) ; // VS remove
100104
101105 return (
102106 < Toast
103107 variant = "success"
108+ placement = "top"
104109 duration = "persistent"
105110 className = "flex-row items-center gap-3"
106111 { ...props }
107112 >
108- < View className = "flex-1 h-[100px] " >
113+ < View className = "flex-1" >
109114 < Toast . Label > { id } </ Toast . Label >
110115 < Toast . Description >
111- Use buttons below to control this toast
116+ Lorem, ipsum dolor sit amet consectetur adipisicing elit. Nam tenetur
117+ maxime ab laboriosam qui praesentium facere? Ad dolor fugiat,
118+ molestiae esse laudantium sed ut ullam.
112119 </ Toast . Description >
113120 </ View >
114121 < Toast . Action onPress = { ( ) => hide ( id ) } > Close</ Toast . Action >
@@ -118,18 +125,24 @@ const MyToast2 = (props: ToastComponentProps) => {
118125
119126const MyToast3 = ( props : ToastComponentProps ) => {
120127 const { id, hide } = props ;
128+ console . log ( '🔴 id 🔴' , id ) ; // VS remove
121129
122130 return (
123131 < Toast
124132 variant = "warning"
133+ placement = "top"
125134 duration = "persistent"
126135 className = "flex-row items-center gap-3"
127136 { ...props }
128137 >
129- < View className = "flex-1 h-[200px] " >
138+ < View className = "flex-1" >
130139 < Toast . Label > { id } </ Toast . Label >
131140 < Toast . Description >
132- Use buttons below to control this toast
141+ Lorem, ipsum dolor sit amet consectetur adipisicing elit. Nam tenetur
142+ maxime ab laboriosam qui praesentium facere? Ad dolor fugiat,
143+ molestiae esse laudantium sed ut ullam. Lorem, ipsum dolor sit amet
144+ consectetur adipisicing elit. Nam tenetur maxime ab laboriosam qui
145+ praesentium facere?
133146 </ Toast . Description >
134147 </ View >
135148 < Toast . Action onPress = { ( ) => hide ( id ) } > Close</ Toast . Action >
@@ -139,9 +152,18 @@ const MyToast3 = (props: ToastComponentProps) => {
139152const InteractiveDemoContent = ( ) => {
140153 const { toast } = useToast ( ) ;
141154
142- const _renderToast1 = ( props : ToastComponentProps ) => < MyToast1 { ...props } /> ;
143- const _renderToast2 = ( props : ToastComponentProps ) => < MyToast2 { ...props } /> ;
144- const _renderToast3 = ( props : ToastComponentProps ) => < MyToast3 { ...props } /> ;
155+ const _renderToast1 = useCallback (
156+ ( props : ToastComponentProps ) => < MyToast1 { ...props } /> ,
157+ [ ]
158+ ) ;
159+ const _renderToast2 = useCallback (
160+ ( props : ToastComponentProps ) => < MyToast2 { ...props } /> ,
161+ [ ]
162+ ) ;
163+ const _renderToast3 = useCallback (
164+ ( props : ToastComponentProps ) => < MyToast3 { ...props } /> ,
165+ [ ]
166+ ) ;
145167
146168 return (
147169 < View className = "flex-1 px-5" >
0 commit comments