Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning: Failed prop type: Invalid prop children supplied to SlidingUpPanel, expected one of type [function]. #213

Open
AparnaManjalavil opened this issue Jun 2, 2022 · 1 comment

Comments

@AparnaManjalavil
Copy link

Issue Description

While running the app this warning is showing. How to fix this?

Code Snippets

MapComponent.js
const snappingPoints = [draggableRange.top,draggableRange.bottom];
const [panelPositionVal, setPanelPositionVal] = useState(new Animated.Value(draggableRange.bottom));
const [draggableRange, setDraggableRange] = useState({
top: hp('70%'),
bottom: Platform.OS==='ios'?hp('30%'):deviceHeight/2.8
});
const [allowDragging, setAllowDragging] = useState(false);
const onMomentumDragEnd = useCallback((value) => {
if (value === draggableRange.bottom) {
setTopSpacing(0);
setSlideUpAtTop(false)
} else {
setTopSpacing(-300);
setSlideUpAtTop(true)
}
}, [draggableRange]);
[enter image description here][1]
<SlidingUpPanel
ref={c =>{
if (panelRef.current == null && c != null) {
panelRef = c
}
}
}
height={draggableRange.top}
animatedValue={panelPositionVal}
draggableRange={draggableRange}
snappingPoints={snappingPoints}
backdropOpacity={0}
showBackdrop={false}
allowDragging={allowDragging}
onMomentumDragEnd={onMomentumDragEnd}>


<View style={{justifyContent: 'center',alignItems: 'center',bottom:-20}}>


<View style={{height:20,justifyContent: 'center',alignItems: 'center',backgroundColor: 'white', marginTop: 2}}>







```
Home.js

  <View style={styles.contentContainer}>
      <MapComponent />
  </View>
</SafeAreaView>

---
### Environment
* Version: 2.4.5
* React Native version: 0.65.1
* Platform(s) (iOS, Android, or both?): Android
* Device info (Simulator/Device? OS version? Debug/Release?): Simulator
@pristinejudah
Copy link

@AparnaManjalavil You are to pass a single ReactElement to the SlidingPanel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants