react-hooks/exhaustive-deps fixes

zio/stable
João Ferreiro 2022-11-29 17:51:06 +00:00
parent 1f16c75121
commit 68e1abf4a9
1 changed files with 4 additions and 7 deletions

View File

@ -48,20 +48,17 @@ export const ComposePost = observer(function ComposePost({
const autocompleteView = useMemo<UserAutocompleteViewModel>( const autocompleteView = useMemo<UserAutocompleteViewModel>(
() => new UserAutocompleteViewModel(store), () => new UserAutocompleteViewModel(store),
[], [store],
) )
const localPhotos = useMemo<UserLocalPhotosModel>( const localPhotos = useMemo<UserLocalPhotosModel>(
() => new UserLocalPhotosModel(store), () => new UserLocalPhotosModel(store),
[], [store],
) )
useEffect(() => { useEffect(() => {
autocompleteView.setup() autocompleteView.setup()
})
useEffect(() => {
localPhotos.setup() localPhotos.setup()
}, [localPhotos]) }, [autocompleteView, localPhotos])
useEffect(() => { useEffect(() => {
// HACK // HACK
@ -78,7 +75,7 @@ export const ComposePost = observer(function ComposePost({
clearTimeout(to) clearTimeout(to)
} }
} }
}, [textInput.current]) }, [])
const onChangeText = (newText: string) => { const onChangeText = (newText: string) => {
setText(newText) setText(newText)