1Copyimport { useFocusEffect } from '@react-navigation/native';
2function Profile({ userId }) { const [user, setUser] = React.useState(null);
3 useFocusEffect( React.useCallback(() => { const unsubscribe = API.subscribe(userId, user => setUser(data));
4 return () => unsubscribe(); }, [userId]) );
5 return <ProfileContent user={user} />;}