Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
alantoa committed Feb 12, 2024
1 parent fc35ae8 commit 39492b3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 15 deletions.
11 changes: 5 additions & 6 deletions example/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -245,12 +245,11 @@ export default function App() {
containerStyle={styles.borderRadius}
thumbWidth={60}
renderThumb={() => (
<View style={{ width: 60, height: 60, bottom: -4 }}>
<AnimatedLottieView
animatedProps={thumbAnimatedProps}
source={require('../assets/rainbow.json')}
/>
</View>
<AnimatedLottieView
animatedProps={thumbAnimatedProps}
source={require('../assets/rainbow.json')}
style={{ width: 60, height: 60, bottom: -4 }}
/>
)}
/>
</View>
Expand Down
2 changes: 1 addition & 1 deletion src/ballon.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { forwardRef, useImperativeHandle, useRef, memo } from 'react';
import { forwardRef, useImperativeHandle, useRef, memo } from 'react';
import {
StyleProp,
TextInput,
Expand Down
16 changes: 8 additions & 8 deletions src/slide.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ export const Slider: FC<AwesomeSliderProps> = memo(function Slider({
let seekWidth = 0;
// when you set step
if (snappingEnabled && markLeftArr.value.length >= step) {
seekWidth = markLeftArr.value[thumbIndex.value] + thumbWidth / 2;
seekWidth = markLeftArr.value[thumbIndex.value]! + thumbWidth / 2;
} else {
seekWidth = progressToValue(progress.value) + thumbWidth / 2;
}
Expand All @@ -371,8 +371,8 @@ export const Slider: FC<AwesomeSliderProps> = memo(function Slider({
// when you set step
if (snappingEnabled && markLeftArr.value.length >= step) {
translateX = stepTimingOptions
? withTiming(markLeftArr.value[thumbIndex.value], stepTimingOptions)
: markLeftArr.value[thumbIndex.value];
? withTiming(markLeftArr.value[thumbIndex.value]!, stepTimingOptions)
: markLeftArr.value[thumbIndex.value]!;
} else if (disableTrackFollow && isScrubbingInner.value) {
translateX = clamp(
thumbValue.value,
Expand Down Expand Up @@ -405,7 +405,7 @@ export const Slider: FC<AwesomeSliderProps> = memo(function Slider({
let translateX = 0;
// when set step
if (snappingEnabled && markLeftArr.value.length >= step) {
translateX = markLeftArr.value[thumbIndex.value] + thumbWidth / 2;
translateX = markLeftArr.value[thumbIndex.value]! + thumbWidth / 2;
} else {
translateX = thumbValue.value + thumbWidth / 2;
}
Expand Down Expand Up @@ -523,10 +523,10 @@ export const Slider: FC<AwesomeSliderProps> = memo(function Slider({
* @returns number
*/
const xToProgress = useCallback(
(x: number) => {
(x: number): number => {
'worklet';
if (snappingEnabled && markLeftArr.value.length >= step) {
return markLeftArr.value[thumbIndex.value];
return markLeftArr.value[thumbIndex.value]!;
} else {
return (
minimumValue.value +
Expand Down Expand Up @@ -558,8 +558,8 @@ export const Slider: FC<AwesomeSliderProps> = memo(function Slider({
}
if (snappingEnabled) {
const index = markLeftArr.value.findIndex((item) => item >= x);
const arrNext = markLeftArr.value[index];
const arrPrev = markLeftArr.value[index - 1];
const arrNext = markLeftArr.value[index]!;
const arrPrev = markLeftArr.value[index - 1]!;
// Computing step boundaries
const currentX = (arrNext + arrPrev) / 2;
const thumbIndexPrev = thumbIndex.value;
Expand Down

0 comments on commit 39492b3

Please sign in to comment.