mirror of
https://github.com/zhigang1992/react-native-bottom-sheet.git
synced 2026-01-12 22:50:12 +08:00
fix: allow 0% snap points (#278)
This commit is contained in:
@@ -14,7 +14,8 @@ export const validateSnapPoint = (snapPoint: any) => {
|
||||
|
||||
invariant(
|
||||
typeof snapPoint === 'number' ||
|
||||
(typeof snapPoint === 'string' && Number(snapPoint.split('%')[0])),
|
||||
(typeof snapPoint === 'string' &&
|
||||
!Number.isNaN(Number(snapPoint.split('%')[0]))),
|
||||
`'${snapPoint}' is not a valid percentage snap point! expected percentage snap point must be only numbers and '%'. e.g. '50%'`
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user