We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi! 👋
Firstly, thanks for your work on this project! 🙂
Today I used patch-package to patch [email protected] for the project I'm working on.
[email protected]
width
height
types.d.ts
Typescript
Here is the diff that solved my problem:
diff --git a/node_modules/react-native-gesture-flip-card/gestureFlipView.js b/node_modules/react-native-gesture-flip-card/gestureFlipView.js index 8ea8ee2..418f4ca 100644 --- a/node_modules/react-native-gesture-flip-card/gestureFlipView.js +++ b/node_modules/react-native-gesture-flip-card/gestureFlipView.js @@ -1,16 +1,16 @@ -import React, { useState, useEffect, useRef, useImperativeHandle } from "react"; +import PropTypes from "prop-types"; +import React, { useEffect, useImperativeHandle, useRef, useState } from "react"; import { - View, Animated, PanResponder, Platform, - StyleSheet, + StyleSheet, View } from "react-native"; -import PropTypes from "prop-types"; const GestureFlipView = React.forwardRef((props, ref) => { - const width = Math.floor(props.width); - const height = Math.floor(props.height); + // Bug fix: using width and height as references avoid memoizing old dimensions within the rest of the component logic + const width = useRef(Math.floor(props.width)).current; + const height = useRef(Math.floor(props.height)).current; const [cardFace, setCardFace] = useState(true); const isAnimating = useRef(false); diff --git a/node_modules/react-native-gesture-flip-card/index.d.ts b/node_modules/react-native-gesture-flip-card/index.d.ts new file mode 100644 index 0000000..e4d03d9 --- /dev/null +++ b/node_modules/react-native-gesture-flip-card/index.d.ts @@ -0,0 +1,17 @@ +import * as React from 'react'; +import { ViewProps } from 'react-native'; + +export type GestureFlipViewrops = { + width: number, + height: number, + perspective?: number, + gestureEnabled?: boolean, + onFlipEnd?: () => void, +} & ViewProps; + +declare class GestureFlipView extends React.Component<GestureFlipViewrops, any> { + flipLeft: () => void; + flipRight: () => void; +} + +export default GestureFlipView;
This issue body was partially generated by patch-package.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi! 👋
Firstly, thanks for your work on this project! 🙂
Today I used patch-package to patch
[email protected]
for the project I'm working on.width
andheight
as references to avoid memoizing old dimensions within the rest of the component logictypes.d.ts
for those crasy devs (like us) usingTypescript
;-)Here is the diff that solved my problem:
This issue body was partially generated by patch-package.
The text was updated successfully, but these errors were encountered: