diff --git a/.changeset/hot-ads-relate.md b/.changeset/hot-ads-relate.md new file mode 100644 index 00000000000..bc3d96e6976 --- /dev/null +++ b/.changeset/hot-ads-relate.md @@ -0,0 +1,5 @@ +--- +"@clerk/clerk-react": patch +--- + +Fixed an issue where `` mounted in a custom page caused an application to freeze. diff --git a/packages/react/src/components/uiComponents.tsx b/packages/react/src/components/uiComponents.tsx index e1889849582..1368145f91e 100644 --- a/packages/react/src/components/uiComponents.tsx +++ b/packages/react/src/components/uiComponents.tsx @@ -257,7 +257,7 @@ const _UserButton = withClerk( const { customPages, customPagesPortals } = useUserProfileCustomPages(props.children, { allowForAnyChildren: !!props.__experimental_asProvider, }); - const userProfileProps = Object.assign(props.userProfileProps || {}, { customPages }); + const userProfileProps = { ...props.userProfileProps, customPages }; const { customMenuItems, customMenuItemsPortals } = useUserButtonCustomMenuItems(props.children, { allowForAnyChildren: !!props.__experimental_asProvider, }); @@ -435,7 +435,7 @@ const _OrganizationSwitcher = withClerk( const { customPages, customPagesPortals } = useOrganizationProfileCustomPages(props.children, { allowForAnyChildren: !!props.__experimental_asProvider, }); - const organizationProfileProps = Object.assign(props.organizationProfileProps || {}, { customPages }); + const organizationProfileProps = { ...props.organizationProfileProps, customPages }; const sanitizedChildren = useSanitizedChildren(props.children); const passableProps = {