The issue: On startup after the splashscreen is shown the List screen shows all users. When app is first loaded useEffect() is being called but the state update is not causing a rerender. However this only happen on startup, if I navigate on another screen and come back to it eveything happens as it should be.
const fetch = async () => {
useMazlsStore.setState({ allUserMazls: await getAllMazls() });
};
useEffect(() => {
fetch();
}, []);
and my zustand store is defined as below :
type MazlsStore = {
allUserMazls: User[];
};
export const useStore = create<Store>((set) => ({
allUsers: [],
}));