rjsf-team/react-jsonschema-form
在 GitHub 查看Exponential slowdown with cross-referencing `oneOf`/`anyOf` definitions
Open
#4,990 建立於 2026年3月13日
help wanted
描述
Prerequisites
- I have searched the existing issues
- I understand that providing a SSCCE example is tremendously useful to the maintainers.
- I have read the documentation
- Ideally, I'm providing a sample JSFiddle, Codesandbox.io or preferably a shared playground link demonstrating the issue.
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
- Open the playground with this schema (5 definitions, A through E, each referencing the other 4 via
oneOf). - Start selecting nested options: pick a type for
child, then pick a type for that child'schild, and so on. - Around depth 8-9 the form freezes for a noticeable number of seconds.