Open walker007 opened 5 months ago
Hi! ๐
Firstly, thanks for your work on this project! ๐
Today I used patch-package to patch
rn-slide-button@1.0.3
for the project I'm working on.Here is the diff that solved my problem:
diff --git a/node_modules/rn-slide-button/src/components/SlideButton.tsx b/node_modules/rn-slide-button/src/components/SlideButton.tsx index 20d55f6..e646adf 100644 --- a/node_modules/rn-slide-button/src/components/SlideButton.tsx +++ b/node_modules/rn-slide-button/src/components/SlideButton.tsx @@ -83,29 +83,29 @@ export type SlideButtonCommonProps = { const SlideButton = ({ width, - height, - borderRadius, - completeThreshold, - disabled, - padding, - title, + height= DEFAULT_HEIGHT, + borderRadius= DEFAULT_BORDER_RADIUS, + completeThreshold= DEFAULT_COMPLETE_THRESHOLD, + disabled=false, + padding= DEFAULT_CONTAINER_PADDING, + title= DEFAULT_TITLE, titleContainerStyle, titleStyle, icon, thumbStyle, containerStyle, underlayStyle, - onReachedToStart, - onReachedToEnd, - onSlideEnd, - onSlideStart, - reverseSlideEnabled, - autoReset, - autoResetDelay, - animation, - animationDuration, - dynamicResetEnabled, - dynamicResetDelaying, + onSlideStart= () => {}, + onSlideEnd= () => {}, + onReachedToStart= () => {}, + onReachedToEnd=() => {}, + reverseSlideEnabled= true, + autoReset= DEFAULT_AUTO_RESET, + autoResetDelay= DEFAULT_AUTO_RESET_DELAY, + animation= DEFAULT_ANIMATION, + animationDuration= DEFAULT_ANIMATION_DURATION, + dynamicResetEnabled= false, + dynamicResetDelaying= false, }: SlideButtonProps) => { const [dimensions, setDimensions] = React.useState({ width: 0, height: 0 }); const [endReached, setEndReached] = React.useState<boolean>(false); @@ -346,26 +346,6 @@ const SlideButton = ({ export default React.memo(SlideButton); -SlideButton.defaultProps = { - height: DEFAULT_HEIGHT, - borderRadius: DEFAULT_BORDER_RADIUS, - padding: DEFAULT_CONTAINER_PADDING, - title: DEFAULT_TITLE, - completeThreshold: DEFAULT_COMPLETE_THRESHOLD, - disabled: false, - reverseSlideEnabled: true, - autoReset: DEFAULT_AUTO_RESET, - autoResetDelay: DEFAULT_AUTO_RESET_DELAY, - animation: DEFAULT_ANIMATION, - animationDuration: DEFAULT_ANIMATION_DURATION, - dynamicResetEnabled: false, - dynamicResetDelaying: false, - onSlideStart: () => {}, - onSlideEnd: () => {}, - onReachedToStart: () => {}, - onReachedToEnd: () => {}, -}; - const styles = StyleSheet.create({ container: { backgroundColor: DEFAULT_CONTAINER_COLOR,
This issue body was partially generated by patch-package.
This solution works fine ๐
Hi! ๐
Firstly, thanks for your work on this project! ๐
Today I used patch-package to patch
rn-slide-button@1.0.3
for the project I'm working on.Here is the diff that solved my problem:
This issue body was partially generated by patch-package.