npm / react-docgen
react-docgen
What changed in react-docgen 6 to 8, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-23.
34 breaking11 new APIs and options1 performance7 behavior and defaults4 tooling18 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initreact-docgen 83 changes
Breaking changes 1
Support is dropped for Node.js 16, 17, 18, 19 and 21; supported versions are Node.js 20.9.0 or newer 20.x versions, and Node.js 22.0.0 or newer.
Fixes and other changes 2
Prevents stack overflows caused by circular interface inheritance and type aliases.
Fixes a crash when classes with private fields are used.
react-docgen 77 changes
Breaking changes 3
Now returns an array of paths to types instead of one, so callers should check whether the array has any elements.
Node.js 14 is no longer supported; the minimum supported version is 16.14.0.
Resolves to an import specifier rather than an ImportDeclaration, so callers can identify the specific specifier and should check the parent path for the declaration.
Tooling 1
Adds support for React.FC in TypeScript.
Fixes and other changes 3
TypeScript component props are now detected correctly when using PropsWithoutRef, PropsWithRef, or PropsWithChildren, though these types do not add props to the documentation.
Fixes detection when a class component's superclass is imported via a named import.
Fixes detection of React.Children when using ESM imports.
react-docgen 665 changes
Breaking changes 30
The library is no longer used, affecting integrations that check and work with the AST.
The project now uses only the Babel toolchain internally, and parser ASTs no longer conform to estree.
The named export
handlerswas renamed tobuiltinHandlers.The named export
importerswas renamed tobuiltinImporters.The named export
resolverwas renamed tobuiltinResolvers.Renames the main export resolver.
The CLI no longer accepts input via stdin.
The handler formerly named
flowTypeHandlerwas renamed because it handles both Flow and TypeScript.Use this annotation to mark a component in place of the removed
@extends React.Componentannotation.The DocumentationBuilder method
toObjectwas renamed tobuild.The exclude option was removed.
react-docgen migrates to ES modules, which can affect how developers import and use the package.
Support for this component annotation on React class components was removed.
This class replaces the
findAllComponentDefinitionsresolver.The utility formerly named
resolveComponentDefinitionwas renamed.The resolver was removed; use
FindExportedDefinitionsResolverwith thelimitoption instead.This class replaces the
findAllExportedComponentDefinitionsresolver.The handler API has no major changes, but integrations must use the Babel toolchain because ast-types is no longer used.
The importer argument was removed from many utilities; importing is now handled through FileState, accessible as
path.hubon NodePath objects.The named export is removed.
The utility was removed; the notes recommend Babel helpers or explicit checks such as
path.isMemberExpression().Only Node.js 14.18.0 or newer is supported.
The method now accepts only source text and a config object, replacing its previous multi-argument signature.
The return value is always an array, including when only one component is found.
The handler was renamed, changing the capitalization of the
binblock.The package is now pure ESM, so consumers must use it as an ES module.
The CLI moved into its own package and was completely rewritten with different arguments and options.
Returned values are now ordered as defined in source code; type handling was removed because it was unused.
Resolvers now receive only a FileState argument, which provides parsing, traversal, options access, and file imports.
The extension option was removed in favor of globs.
New APIs and options 11
babelTypes is now exported and includes all types from @babel/types.
Adds a resolver that chains multiple resolvers using configurable chaining logic.
Adds an annotation for identifying components; its resolver is enabled by default.
Adds displayName and description to the Documentation type.
The DocumentationBuilder type is now exported for integrations.
Exports codes for detecting errors, including MISSING_DEFINITION and MULTIPLE_DEFINITIONS.
A fail-on-warning option was added to the CLI.
A handler option was added to the CLI.
An importer option was added to the CLI.
NodePath is now exported for building TypeScript integrations.
Resolvers can now be classes as well as functions.
Performance 1
Caches file resolution in addition to parsing; clear the caches on every file change when files can change at runtime.
Behavior and default changes 7
The path argument now accepts a glob.
The handler now supports all possible kinds of functions.
Flow parsing now supports qualified type names.
The ignore option now accepts a glob.
Functions returning React.Children.map are now treated as components.
Resolution now supports destructuring.
JSDoc comments are now parsed for TypeScript structs.
Tooling 3
TypeScript parsing now supports files with the .cts extension.
TypeScript parsing now supports files with the .mts extension.
The package is written in TypeScript and now includes type definitions in its published package.
Fixes and other changes 13
Parsing now supports class and function declarations without an identifier.
Correctly resolves values in an Object.values() call.
Handles cyclic references in PropTypes shape() and exact() methods.
Fixes handling of unresolved imported values.
Fixes using react-docgen in browsers.
Handles React.forwardRef calls that do not include a function.
Fixes TypeScript types when strict null checks are disabled.
Adds support for TSAsExpressions when stringifying expressions.
TypeScript now handles typeof import('...') correctly.
TypeScript now handles typeof MyType.property correctly.
TypeScript parsing now supports all possible literal types.
Fixes a crash when using TypeScript mapped types.
Handling of useImperativeHandle is now correct.