Skip to content

Commit

Permalink
prevent component rendering on server-side
Browse files Browse the repository at this point in the history
  • Loading branch information
BiswaViraj committed Jan 16, 2025
1 parent 09c2521 commit f79663e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/js/src/ui/novuUI.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Accessor, Setter, ComponentProps, createSignal } from 'solid-js';
import { MountableElement, render } from 'solid-js/web';
import { isServer, MountableElement, render } from 'solid-js/web';
import type { NovuOptions } from '../types';
import { NovuComponent, NovuComponentName, novuComponents, Renderer } from './components/Renderer';
import { generateRandomString } from './helpers';
Expand Down Expand Up @@ -69,7 +69,9 @@ export class NovuUI {
this.#preferencesFilter = preferencesFilter;
this.#setPreferencesFilter = setPreferencesFilter;

this.#mountComponentRenderer();
if (!isServer) {
this.#mountComponentRenderer();
}
}

#mountComponentRenderer(): void {
Expand Down

0 comments on commit f79663e

Please sign in to comment.