File tree Expand file tree Collapse file tree 1 file changed +13
-8
lines changed
Expand file tree Collapse file tree 1 file changed +13
-8
lines changed Original file line number Diff line number Diff line change 1- import React , { PropTypes } from 'react' ;
1+ // @flow
2+ import * as React from 'react' ;
23import {
3- NativeModules ,
44 requireNativeComponent ,
5- View ,
65 UIManager ,
76 findNodeHandle ,
87} from 'react-native' ;
98
109const PTRKeyframesView = requireNativeComponent ( 'PTRKeyframesView' , Keyframes ) ;
1110
12- class Keyframes extends React . Component {
11+ type Props = {
12+ onStop : Function
13+ } ;
14+
15+ class Keyframes extends React . Component < Props > {
1316 constructor ( props ) {
1417 super ( props ) ;
18+
19+ this . ref = React . createRef ( ) ;
1520 }
1621
17- onStop = ( e ) => {
22+ onStop = ( ) => {
1823 if ( this . props . onStop ) {
1924 this . props . onStop ( ) ;
2025 }
@@ -24,13 +29,13 @@ class Keyframes extends React.Component {
2429 return (
2530 < PTRKeyframesView
2631 onStop = { this . onStop }
27- ref = { ref => ( this . ref = ref ) }
32+ ref = { this . ref }
2833 { ...this . props }
2934 />
3035 ) ;
3136 }
3237
33- seek ( position ) {
38+ seek ( position : number ) {
3439 this . runCommand ( 'seek ', [ position ] ) ;
3540 }
3641
@@ -63,7 +68,7 @@ class Keyframes extends React.Component {
6368 }
6469
6570 getHandle ( ) {
66- return findNodeHandle ( this . ref ) ;
71+ return findNodeHandle ( this . ref . current ) ;
6772 }
6873}
6974
You can’t perform that action at this time.
0 commit comments