rjsf-team/react-jsonschema-form

Exponential slowdown with cross-referencing `oneOf`/`anyOf` definitions

Open

#4990 opened on Mar 13, 2026

View on GitHub
 (0 comments) (0 reactions) (1 assignee)TypeScript (13,175 stars) (2,136 forks)batch import
help wanted

Description

Prerequisites

What theme are you using?

other

Version

6.4.1

Current Behavior

Schemas where definitions reference each other through oneOf/anyOf become unresponsive at deeper nesting levels. The time to select an option grows exponentially with depth.

Using the attached schema (5 definitions, each with a child property whose oneOf references the other 4), here are the measured times:

Nesting depth Time to select an option
8 4s
9 13s
10 49s

The time roughly triples with each additional level. With more definitions, the freeze happens at shallower depth.

Expected Behavior

The form should remain responsive regardless of the number of definitions or depth.

Steps To Reproduce

  1. Open the playground with this schema (5 definitions, A through E, each referencing the other 4 via oneOf).
  2. Start selecting nested options: pick a type for child, then pick a type for that child's child, and so on.
  3. Around depth 8-9 the form freezes for a noticeable number of seconds.

Contributor guide