Skip to main content
Skip table of contents

Opting Out of the System Theme

The system theme is a theme on the Dart-Platform that ensures UI components in the User Module and MUI components have a consistent appearance.

However, some developers may prefer to showcase components with their own unique styles or may encounter issues where certain styles do not function correctly and thus may not want to use the system theme.

In such cases, the module can be built and deployed without the system theme by following these steps:

Within the render() function of the Index.tsx file,

  1. Move components like <App moduleContext={this.moduleContext} /> outside of the <ThemeProvider> tag.

  2. Comment out the <ThemeProvider> JSX code or remove it entirely.

    1. To comment out the code in JSX, wrap the code you want to comment out with /* and */.

image-20241024-023901.png
TYPESCRIPT
class MainScreen extends ModuleScreen {
    constructor(props: ModuleScreenProps) {
        super(props);
    }
    componentWillUnmount() {
        // Must delete DrlUtils Instance to free up memory
        DrlUtils.deleteInstance();
    }
    render() {
        return (
            /*<ThemeProvider theme={this.systemTheme}>
            </ThemeProvider>*/
            <App moduleContext={this.moduleContext} />
        );
    }
}
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.