Skip to content
New issue

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

Fixed the warning in the package #20

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions src/Carousel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export interface CarouselProps {
autoplay?: boolean;
autoplayTimeout?: number;
slipFactor?: number;
animation?: (animate: Animated.Value, toValue: number, useNativeDriver: false,) => Animated.CompositeAnimation;
animation?: (animate: Animated.Value, toValue: number) => Animated.CompositeAnimation;
onPageChanged?: (index: number) => void;
showsPageIndicator?: boolean;
renderPageIndicator?: (config: PageIndicatorConfig) => JSX.Element;
Expand Down Expand Up @@ -47,7 +47,8 @@ export default class Carousel extends React.Component<CarouselProps, CarouselSta
return Animated.spring(animate, {
toValue: toValue,
friction: 10,
tension: 50
tension: 50,
useNativeDriver: false
});
}
};
Expand All @@ -68,7 +69,7 @@ export default class Carousel extends React.Component<CarouselProps, CarouselSta
};
}

public componentWillMount() {
public UNSAFE_componentWillMount() {
this.panResponder = PanResponder.create({
onStartShouldSetPanResponder: () => {
this.startPanResponder();
Expand Down Expand Up @@ -109,7 +110,7 @@ export default class Carousel extends React.Component<CarouselProps, CarouselSta
this.gotoPage(this.props.index + (this.props.loop ? 1 : 0), false);
}

public componentWillReceiveProps(nextProps: CarouselProps) {
public UNSAFE_componentWillReceiveProps(nextProps: CarouselProps) {
if (nextProps.autoplay) {
this.startAutoPlay();
} else {
Expand Down
28 changes: 28 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1


"@types/prop-types@*":
version "15.7.3"
resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.3.tgz#2ab0d5da2e5815f94b0b9d4b95d1e5f243ab2ca7"
integrity sha512-KfRL3PuHmqQLOG+2tGpRO26Ctg+Cq1E01D2DMriKEATHgWLfeNDmq9e29Q9WIky0dQ3NPkd1mzYH8Lm936Z9qw==

"@types/react-native@^0.46.9":
version "0.46.11"
resolved "https://registry.yarnpkg.com/@types/react-native/-/react-native-0.46.11.tgz#e16013b6a99bb5dd24873f16b7d959daff66cb62"
integrity sha512-yPCn6QnCVNixiPc4rqNK85StohRmJGnyCd3Hw6PYIk2JNYnqCXhUyKHQ6ZY3/V5bbhjaipsvZjpt5jp9oeDE3w==
dependencies:
"@types/react" "*"

"@types/react@*":
version "16.9.41"
resolved "https://registry.yarnpkg.com/@types/react/-/react-16.9.41.tgz#925137ee4d2ff406a0ecf29e8e9237390844002e"
integrity sha512-6cFei7F7L4wwuM+IND/Q2cV1koQUvJ8iSV+Gwn0c3kvABZ691g7sp3hfEQHOUBJtccl1gPi+EyNjMIl9nGA0ug==
dependencies:
"@types/prop-types" "*"
csstype "^2.2.0"

csstype@^2.2.0:
version "2.6.10"
resolved "https://registry.yarnpkg.com/csstype/-/csstype-2.6.10.tgz#e63af50e66d7c266edb6b32909cfd0aabe03928b"
integrity sha512-D34BqZU4cIlMCY93rZHbrq9pjTAQJ3U8S8rfBqjwHxkGPThWFjzZDQpgMJY0QViLxth6ZKYiwFBo14RdN44U/w==