@@ -17,17 +17,31 @@ import React from 'react';
1717
1818import { useClerkRemixOptions } from './RemixOptionsContext' ;
1919
20- export const UserProfile = ( props : UserProfileProps ) => {
21- return < BaseUserProfile { ...useRoutingProps ( 'UserProfile' , props ) } /> ;
22- } ;
20+ // The assignment of UserProfile with BaseUserProfile props is used
21+ // to support the CustomPage functionality (eg UserProfile.Page)
22+ // Also the `typeof BaseUserProfile` is used to resolved the following error:
23+ // "The inferred type of 'UserProfile' cannot be named without a reference to ..."
24+ export const UserProfile : typeof BaseUserProfile = Object . assign (
25+ ( props : UserProfileProps ) => {
26+ return < BaseUserProfile { ...useRoutingProps ( 'UserProfile' , props ) } /> ;
27+ } ,
28+ { ...BaseUserProfile } ,
29+ ) ;
2330
2431export const CreateOrganization = ( props : CreateOrganizationProps ) => {
2532 return < BaseCreateOrganization { ...useRoutingProps ( 'CreateOrganization' , props ) } /> ;
2633} ;
2734
28- export const OrganizationProfile = ( props : OrganizationProfileProps ) => {
29- return < BaseOrganizationProfile { ...useRoutingProps ( 'OrganizationProfile' , props ) } /> ;
30- } ;
35+ // The assignment of OrganizationProfile with BaseOrganizationProfile props is used
36+ // to support the CustomPage functionality (eg OrganizationProfile.Page)
37+ // Also the `typeof BaseOrganizationProfile` is used to resolved the following error:
38+ // "The inferred type of 'OrganizationProfile' cannot be named without a reference to ..."
39+ export const OrganizationProfile : typeof BaseOrganizationProfile = Object . assign (
40+ ( props : OrganizationProfileProps ) => {
41+ return < BaseOrganizationProfile { ...useRoutingProps ( 'OrganizationProfile' , props ) } /> ;
42+ } ,
43+ { ...BaseOrganizationProfile } ,
44+ ) ;
3145
3246export const SignIn = ( props : SignInProps ) => {
3347 const { signInUrl } = useClerkRemixOptions ( ) ;
0 commit comments