Question: In Next.js during SSR I get user object from session and ip address of client that performed request.

```
 return {
   props: {
     user,
     ipAddress,
   },
 };

```

User can exist but it can also be undefined if request is unauthenticated. I want to be able to:

1. If user is authenticated run react-query hook that uses `user.id` and fetches user settings.
2. If user is not authenticated provide default settings values that I have stored in config file.

```
const LandingPage = ({
  user,
  ipAddress,
}: LandingPageProperties): JSX.Element => {

  // User exist

  const { config } = useGetOwnSettingsQuery(
    {
      endpoint: 'http://localhost:3000/api/graphql',
      fetchParams: {
        headers: setFetchHeaders(),
      },
    },
    { userWhere: { id: user?.id } },
  );

  // User does not exist

  imported config from config.ts

  return <LandingPageMap className="map" { config goes here }/>;
};

```

I really dont have good idea how to perform what I want, hooks do not like if I call them inside useEffect and they dont like if I return early to check if user exist.

Answer: 
When I installed VS2022 preview 4, my configuration became `C:\Program Files\Microsoft\jdk-11.0.10.9-hotspot`

This can be fixed for you if you run the `maui-check` command (if you installed that component during visual studio installation).

If you don't have the `maui-check` tool, you can get it by running the `dotnet tool install -g Redth.Net.Maui.Check` command

Maybe you skipped a step during installation and that's why you get the error.
Visual Studio for Mac
=====================

Here's how I got it working on macOS with Visual Studio for Mac.

Install Microsoft Open JDK
--------------------------

On macOS, [install the Microsoft Open JDK](https://learn.microsoft.com/java/openjdk/install#install-on-macos?WT.mc_id=mobile-0000-bramin) using HomeBrew:

```sh
brew install --cask microsoft-openjdk

```

Configure Visual Studio for Mac
-------------------------------

1. In Visual Studio for Mac, select **Visual Studio** -> **Preferences**.
2. In the **Preferences** window, navigate to **SDK Locations** -> **Android** -> **Locations**.
3. In the **Java SDK (JDK) Location:** text box, enter the following:

```sh
/Library/Java/JavaVirtualMachines/jdk-13.0.1.jdk/Contents/Home

```

4. Click **OK**

[![enter image description here](https://i.stack.imgur.com/j38PD.png)](https://i.stack.imgur.com/j38PD.png)