Skip to content

Commit

Permalink
fix(react): use hydrateRoot
Browse files Browse the repository at this point in the history
  • Loading branch information
coldlink committed Sep 17, 2024
1 parent af9d843 commit 1519a25
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/client/static/hydration.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { record } from '@/client/lib/ophan';
import { hydrate } from 'react-dom';
import { hydrateRoot } from 'react-dom/client';
import { RoutingConfig } from '@/client/routes';
import { App } from '@/client/app';
import { tests } from '@/shared/model/experiments/abTests';
Expand Down Expand Up @@ -51,7 +51,8 @@ export const hydrateApp = ({ routingConfig }: Props) => {
getCurrentHub().bindClient(client);
}

hydrate(
hydrateRoot(
document.getElementById('app')!,
<ABProvider
arrayOfTestObjects={tests}
abTestSwitches={abSwitches}
Expand All @@ -65,6 +66,5 @@ export const hydrateApp = ({ routingConfig }: Props) => {
>
<App {...clientState} location={`${routingConfig.location}`} />
</ABProvider>,
document.getElementById('app'),
);
};

0 comments on commit 1519a25

Please sign in to comment.