@svg-use/react / configContext
const
configContext:Context
<Config
>
Defined in: packages/react/src/ThemedExternalSvg.tsx:63
A context that you can use to customise the runtime behavior of
ThemedExternalSvg
. Because ThemedExternalSvg
is usually a compilation
target, this allows you to inject configuration without changing the signature
of modules.
import { configContext, type Config } from '@svg-use/react';
const config: Config = {
// Add any config options here
rewritePath: (pathOrHref) => pathOrHref,
runtimeChecksEnabled: process.env.NODE_ENV !== 'production',
};
const AppRoot = () => {
return (
<configContext.Provider value={config}>
{/* The rest of the application */}
</configContext.Provider>
);
};