Next.js Discord

Discord Forum

RSC server functions in client components

Unanswered
Basque Shepherd Dog posted this in #help-forum
Open in Discord
Basque Shepherd DogOP
I am trying to set up a custom Clerk profile page (custom tab in the account portal).
I am having issues understanding how to make this work.
just as a test, I want to show the user their clerk if in the database. so I was doing something like this:

'use client';
import ...;
export default function UserProfilePage() {
  const userID = getUserId();
  return (
    <UserProfile path="/settings" routing="path">
      <UserProfile.Page label="Billing" url="billing">
      {userID}
      </UserProfile.Page>
      </UserProfile>
  );
}

async function getUserID() {
  'use server';
  return '12345';
}

how do I get the user ID because this does not work

3 Replies

Basque Shepherd DogOP
edit:
I am now doing this, but this does not work either. I have the function in a different file with the user server at the top. why won't this work?
the UserPrifilePage() function is in a file with use client at the top