diff options
author | Ivan Chen <ivan@tagg.id> | 2021-06-25 17:05:14 -0400 |
---|---|---|
committer | Ivan Chen <ivan@tagg.id> | 2021-06-25 17:05:14 -0400 |
commit | acc7081036177e036bd7f43c7975939d33e91f2c (patch) | |
tree | 6e5fff671b2fa7366e5c2e3c3356a8cc1b1f8b23 /src/components/moments | |
parent | 4bab63b7b0c24043749e78cbb4d639e8a4047bad (diff) |
Cleanup ref types
Diffstat (limited to 'src/components/moments')
-rw-r--r-- | src/components/moments/MomentPost.tsx | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/components/moments/MomentPost.tsx b/src/components/moments/MomentPost.tsx index e6bb5405..7d0752d5 100644 --- a/src/components/moments/MomentPost.tsx +++ b/src/components/moments/MomentPost.tsx @@ -1,5 +1,13 @@ import {useNavigation} from '@react-navigation/native'; -import React, {useContext, useEffect, useRef, useState} from 'react'; +import React, { + createRef, + LegacyRef, + MutableRefObject, + useContext, + useEffect, + useRef, + useState, +} from 'react'; import { Image, KeyboardAvoidingView, @@ -72,6 +80,7 @@ const MomentPost: React.FC<MomentPostProps> = ({ const [momentTagId, setMomentTagId] = useState<string>(''); const imageRef = useRef(null); + const videoRef = useRef<Video>(null); const {keyboardVisible, currentVisibleMomentId} = useContext(MomentContext); const isVideo = !( moment.moment_url.endsWith('jpg') || @@ -197,6 +206,7 @@ const MomentPost: React.FC<MomentPostProps> = ({ }, ]}> <Video + ref={videoRef} source={{ uri: moment.moment_url, }} |