Closed jv640 closed 2 years ago
Hi,
Can you print and forward the "props" console in the "component"?
sample code;
const component = (props) => {
console.log('props',props);
//console.log('spSheet',props.hide()); please try this
return (
<View>
<View style={styles.header}> <Text style={styles.sheetHeader}>Subscribe to {plan.Title}</Text> </View>
<View>
<SubmitButton isDisabled={isLoaded} handleSubmit={() => props.spSheet.hide()} title={'Cancel'}/>
<SubmitButton isDisabled={isLoaded} handleSubmit={() => console.log('confirmed')} title={'Confirm'}/>
</View>
</View>
);
};
const handleSubscribe = () => {
console.log('purchasee clicked');
const spSheet = SPSheet;
spSheet.show({
component: () => component({spSheet}), // {spSheet} or spSheet
dragFromTopOnly: true,
height: '40%'
});
};
Hi
I'm using spsheet in one of my project and stuck in this issue
const component = ( props) => ( <View> <View style={styles.header}> <Text style={styles.sheetHeader}>Subscribe to {plan.Title}</Text> </View> <View> <SubmitButton isDisabled={isLoaded} handleSubmit={() => props.spSheet.hide()} title={'Cancel'} /> <SubmitButton isDisabled={isLoaded} handleSubmit={() => console.log('confirmed')} title={'Confirm'} /> </View> </View> ); const handleSubscribe = () => { console.log('purchasee clicked'); const spSheet = SPSheet; spSheet.show({ component: () => component({ spSheet }), dragFromTopOnly: true, height: '40%', }); };
when I'm pressing cancel button it is showing this error
TypeError: spSheet.hide is not a function. (In 'spSheet.hide()', 'spSheet.hide' is undefined)
Hi, maybe you forgot to add the provider integration
import { Root, SPSheet } from 'react-native-popup-confirm-toast'
App.js ->
<Root>
....
</Root>
I'm using spsheet in one of my project and stuck in this issue
` const component = ( props) => (
); const handleSubscribe = () => { console.log('purchasee clicked'); const spSheet = SPSheet; spSheet.show({ component: () => component({ spSheet }), dragFromTopOnly: true, height: '40%', }); };`
when I'm pressing cancel button it is showing this error
TypeError: spSheet.hide is not a function. (In 'spSheet.hide()', 'spSheet.hide' is undefined)