octopitus / rn-sliding-up-panel

Draggable sliding up panel implemented in React Native https://octopitus.github.io/rn-sliding-up-panel/
MIT License
929 stars 157 forks source link

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

Open AparnaManjalavil opened 2 years ago

AparnaManjalavil commented 2 years ago

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] { 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}> ``` **Home.js** ``` --- ### 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 commented 2 years ago

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