A/B Testing Tool for React & SPA (Reddit Roundup)

"What A/B testing software do you use?" is a common r/webdev thread. The replies split into a pattern once you filter for people building React, Vue, or other client-rendered apps: a lot of them are complaining about a visual editor that broke, not recommending one.

This page is published by Mida, one of the tools discussed below, so weigh that accordingly. The underlying problem is technical, and worth understanding before you pick a tool.

Quick answer

Ask this in r/webdev and the answers split roughly three ways.

  • Teams with backend engineers usually build experiments into feature flags with GrowthBook, LaunchDarkly, or PostHog.
  • Teams running client-side visual tests on marketing pages lean on VWO, Optimizely, or Convert Experiences.
  • Teams that have specifically had visual editors break on React/Vue apps look for tools built around URL and DOM-change triggers instead of static selectors — Mida is one option built this way.

Why visual editors break on SPAs

Most visual A/B testing editors work by targeting a CSS selector and injecting a change when the page loads. That works fine on a traditional server-rendered site where the DOM is stable.

It breaks down on React, Vue, Angular, and other client-rendered frameworks for a few predictable reasons:

  • Routing happens client-side, so there's no full page load to hook into.
  • Component re-renders can regenerate class names or DOM structure, especially with CSS-in-JS or utility-class hashing.
  • Content that loads asynchronously after the initial render simply isn't there yet when the editor tries to apply a change.

The result, reported constantly in these threads, is a test that works on the first page load and then silently stops applying after a client-side route change.

What actually holds up: URL and DOM-change triggers

The fix isn't a "better" visual editor — it's a different triggering model. Tools built for SPAs generally offer a way to fire a test on a URL change, so client-side route transitions are caught and not just the initial page load, or on a specific DOM mutation, so a test can wait for an element to actually exist before touching it.

Mida's editor supports both triggers — by URL change, by any DOM change, or by a specific DOM change — plus a code editor for teams that want to write the targeting logic directly instead of relying on a visual selector at all.

If you're evaluating any tool for a React or Vue app, ask specifically how it handles client-side navigation and re-renders before you commit.

Free A/B Testing Tool

Run your next A/B test the right way

Visual editor, 15 KB script, GA4-native — and free forever up to 100,000 monthly visitors. No developer required.

✓ Visual editor✓ 15 KB script✓ GA4 integration✓ Free up to 100k visitors
Try Mida free →

MidaGX: generating targeting code from a description

A newer approach some of these threads mention is skipping the visual editor's selector-matching entirely. Mida's MidaGX generates targeting code from a plain-language description of the change you want.

That tends to be more resilient to the kind of DOM churn that breaks selector-based editors, since the generated code can be reviewed and adjusted like any other script rather than depending on a UI recording a click path. It supports React, Vue, Angular, and other single-page app frameworks out of the box.

For the full technical breakdown of how Mida handles SPA testing — triggers, the visual editor, and script weight — see our A/B testing for single-page applications feature page.

Feature-flag tools: the engineering-led alternative

If your team already ships behind feature flags, the more common Reddit answer is to skip visual A/B testing tools entirely and build experiments on top of your existing flagging system.

GrowthBook, LaunchDarkly, and PostHog all support this pattern — you gate a component or code path behind a flag, assign users to variants server-side or in your app's bootstrap logic, and log exposure events yourself.

It avoids the DOM-targeting problem completely because there's no selector to break, at the cost of needing an engineer to wire up every test rather than a marketer launching one visually.

Options compared

Mida

Visual editor with URL and DOM-change triggers, code editor, MidaGX for AI-generated targeting code. Free Sandbox plan up to 100,000 MTU.

Best for: marketing or CRO teams testing on a React/Vue marketing site without an engineer on every test.

GrowthBook / LaunchDarkly

Feature-flag-based experimentation with no DOM targeting involved.

Best for: engineering-led teams that already ship behind flags.

PostHog

Feature flags and experimentation bundled with product analytics and session replay.

Best for: product teams instrumenting experiments in code alongside their existing event tracking.

For a deeper technical walkthrough of triggers, script weight, and SPA-specific setup, see our A/B testing for SPA feature page. For the broader tool comparison, see our Best A/B Testing Tools guide.

Create A/B tests by chatting with AI and launch them on your website within minutes.

Try it for FREE now

Frequently asked questions

Why does my A/B testing tool stop working after a React route change?

Accordion icon

Most visual editors apply changes once, on initial page load, by targeting a CSS selector. Client-side routing in React or Vue doesn't trigger a full page load, so the editor never re-applies the change. Tools that support triggering by URL change or DOM mutation, instead of only on load, avoid this.

What A/B testing tool works well with single-page apps?

Accordion icon

Look for a tool with explicit URL-change and DOM-change triggers rather than one that only fires on page load. Mida supports both, plus a code editor and MidaGX for generating targeting code that's less dependent on a fixed selector.

Should engineering-led teams just use feature flags instead?

Accordion icon

If you already ship behind feature flags, tools like GrowthBook, LaunchDarkly, or PostHog let you build experiments on top of that system with no DOM targeting involved — at the cost of needing an engineer to wire up each test.

The A/B testing platform for people who
care about website performance

Free up to 100,000 monthly tested users. No credit card, no sales call.

Decorative graphicDecorative graphicDecorative graphicDecorative graphic