Skip to content

Commit 9925cf8

Browse files
author
Gabriel Peal
committed
Remove some references to config
1 parent f8ec09c commit 9925cf8

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

example/js/LottieAnimatedExample.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,10 @@ export default class LottieAnimatedExample extends React.Component {
6262
if (this.state.imperative) {
6363
this.anim.play();
6464
} else {
65-
this.state.progress.setValue(0);
65+
this.state.progress.setValue(0.5);
6666
Animated.timing(this.state.progress, {
6767
toValue: 1,
68-
duration: this.state.config.duration,
68+
duration: this.state.duration,
6969
easing: Easing.linear,
7070
}).start(({ finished }) => {
7171
if (finished) this.forceUpdate();
@@ -128,10 +128,7 @@ export default class LottieAnimatedExample extends React.Component {
128128
>
129129
<Text>Use Imperative API:</Text>
130130
<View />
131-
<Switch
132-
onValueChange={i => this.onConfigChange({ imperative: i })}
133-
value={imperative}
134-
/>
131+
<Switch onValueChange={i => this.setState({ imperative: i })} value={imperative} />
135132
</View>
136133
<View style={{ paddingBottom: 10 }}>
137134
<View>
@@ -153,7 +150,7 @@ export default class LottieAnimatedExample extends React.Component {
153150
minimumValue={50}
154151
maximumValue={4000}
155152
value={duration}
156-
onValueChange={d => this.onConfigChange({ duration: d })}
153+
onValueChange={d => this.setState({ duration: d })}
157154
/>
158155
</View>
159156
</View>

0 commit comments

Comments
 (0)