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