Releases: UdaySravanK/RNSwipeButton
Releases · UdaySravanK/RNSwipeButton
Warning Fixes, Dependency upgrades and 2 lines title support
- Upgraded the react and react-native min required dependencies
- Fixed code analysis warnings. Deprecated defaultProps and thumIconComponent type error.
- Added support to set the max number of lines
Handle the deprecated removeEventListener
Patch release v1.3.8 fixes issue #92
New prop titleMaxFontScale
#68 Supporting large font size
- Introduced a new prop "titleMaxFontScale" to support large font scaling
New prop thumbIconWidth
New prop disableResetOnTap
Fixed git issue #49: Prevent returning to initial state
- Adding a new prop called disableResetOnTap. After swipe success, tap on button resets it. This behavior can be disabled by setting this prop to true.
Use updated props in PanResponder callbacks
Issue: Using useRef memoizes initial disable value. So the swipe functionality continues to work though the disabled prop is set as true.
Fix: Use useCallback instead of useRef to update PanResponder callbacks every time props update
Example:
const MyComponent = (props) => {
const [disableSwipeButton, setDisableSwipeButton] = useState(false)
return (
<div>
<RNSwipeButton disabled={disableSwipeButton} />
<Button onPress={() => setDisableSwipeButton(!disableSwipeButton)} title="Toggle disable" />
</div>
)
}
railStyles defect fix
This release has
railStyles
prop is not overriding thumb rail container styles. Due to which unable to match the rail styles with button container styles. With this release developer will get full control to style the thumb rail container.
Example code snippet:
<SwipeButton
containerStyles={{ borderRadius: 5 }}
railStyles={{ borderRadius: 5 }}
/>
Right to left (RTL) layouts support
This release has
- Fix for issue #38
enableRightToLeftSwipe
prop has been renamed toenableReverseSwipe
, so it makes sense for both LTR and RTL layouts.- Out of the box support for RTL layouts.
If RTL is enabled at OS settings (by selecting languages like Arabic) then thern-swipe-button
works automatically as right to left swipe. To change it back to left to right swipe, propenableReverseSwipe
can be used.
v1.3.0
Supporting [email protected]
This release includes
- Support for [email protected]
- Converting class component to functional component using hooks
- Improved panResponder
Below issue has been fixed