Noticing that `antiFlicker` is deprecated with the...
# sdk-react
l
Noticing that
antiFlicker
is deprecated with the React SDK...is there a better method to avoid page-to-page flicker/jumping with URL redirect testing? I've got the redirect working with Next.js, but it shows the first page very briefly before navigating to the second page. Preferably it could be handled with Middleware, does anyone have any resources on URL split testing with middleware? Right now everything in our setup is client side.
b
Hi Cory 👋🏻 You're correct: the
antiFlicker
option is now deprecated in the React SDK and only available in the HTML Script Tag SDK. For client-side URL redirect tests (including with Next.js), this means you may see a brief flash of the original page before the redirect occurs—a common issue with client-side A/B testing. To truly eliminate flicker, the recommended approach is to handle the split and redirect at the edge or server level, before any page content is rendered. This ensures users only ever see the correct variation, with no flash of the original page. GrowthBook provides Edge SDKs for this purpose, supporting platforms like Cloudflare Workers, Fastly, and AWS Lambda@Edge. These SDKs natively support redirect tests without flicker or tracking delays Edge SDKs. With Next.js, you can use middleware to perform the experiment assignment and redirect before the page loads. This is the preferred method for split testing entire pages, as it avoids client-side flicker. The general idea is: 1. In your middleware, use GrowthBook to assign the user to a variation. 2. If the user is assigned to the variant, redirect them to the variant page before rendering.
The AI-powered chat widget in the lower right corner of our documentation site was actually pretty helpful for this question, in case you want to check it out! https://docs.growthbook.io/