Ensure library-provided integration points are used so styles and portals behave correctly in host environments (e.g., shadow roots, webcomponents).

Motivation

How to apply 1) Use provider APIs for style nonces

const root = document.getElementById(‘root’) as HTMLDivElement const nonce = root.getAttribute(‘nonce’) || undefined

ReactDOM.createRoot(root).render( <MantineProvider theme={theme} getStyleNonce={() => nonce} forceColorScheme={scheme}> </MantineProvider> )

Or, if a component needs the nonce at runtime, use the hook inside the component:

function SomeComponent() { const styleNonce = useMantineStyleNonce() // use styleNonce when necessary }

2) Forward portal/overlay props when rendering inside shadow roots

const ResetControlPointsButton = ({ portalProps }) => { return ( <Tooltip label=”Reset all control points” {…portalProps}> </Tooltip> ) }

Checklist

References: 0, 1