Skip to content

Commit

Permalink
Fix issue with PortfolioWebParts crashing [skip-ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
Remi749 committed Jan 23, 2024
1 parent c73ce75 commit b4d9093
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { render } from 'react-dom'
import { ErrorBoundary } from 'react-error-boundary'
import { DataAdapter } from '../../data'
import { ErrorBoundaryFallback } from './ErrorBoundary'
import { FluentProvider, IdPrefixProvider, useId } from '@fluentui/react-components'
import { FluentProvider } from '@fluentui/react-components'

type ComponentType<P> = FC<P> | ComponentClass<P>

Expand Down Expand Up @@ -54,7 +54,6 @@ export abstract class BasePortfolioWebPart<
* @param props Props to pass to the component
*/
public renderComponent<P = any>(component: ComponentType<P>, props?: Partial<P>): void {
const fluentProviderId = useId('fp-base-portfolio-web-part')
const combinedProps = this.createPropsForComponent(props)
const element = createElement(component, combinedProps)

Expand All @@ -64,9 +63,7 @@ export abstract class BasePortfolioWebPart<
<ErrorBoundaryFallback title={combinedProps['title']} error={error} />
)}
>
<IdPrefixProvider value={fluentProviderId}>
<FluentProvider theme={customLightTheme}>{element}</FluentProvider>
</IdPrefixProvider>
<FluentProvider theme={customLightTheme}>{element}</FluentProvider>
</ErrorBoundary>,
this.domElement
)
Expand All @@ -87,7 +84,7 @@ export abstract class BasePortfolioWebPart<
Title: string
}>()
).Title
} catch (error) {}
} catch (error) { }
}

public async onInit(): Promise<void> {
Expand Down

0 comments on commit b4d9093

Please sign in to comment.