Looking at a React Native app in TypeScript, and there is this fragment in a screen file:
export const DetailPageScreen: FC<StackScreenProps<AuthorizedNavigatorParamList, 'Details'>> = observer(({ route, navigation }) => { useEffect(() => { void (async () => { await SomeFunction(); })(); }, []);
Help me parse what goes into useEffect
. It's a function with a body that goes:
() =>{ void (async () => { await SomeFunction(); })();}
So what's inside the parentheses after void
is an async function invocation without an await
- an expression that results in a promise, I presume. So what is void
doing here, exactly? It boils down to void promiseObject
, if I followed this right.