Skip to content

Releases: reactjs/react-docgen

[email protected]

19 Oct 18:21
7d7d210
Compare
Choose a tag to compare

Minor Changes

  • #923
    3033ca0
    Thanks @rvetere! - Support generic types on
    React.forwardRef calls.

    Example:

    react-docgen will now find IButtonProps.

    export const FullWidthButton = forwardRef<HTMLButtonElement, IButtonProps>(
      () => {},
    );

@react-docgen/[email protected]

19 Oct 18:21
7d7d210
Compare
Choose a tag to compare

Patch Changes

[email protected]

12 Jan 00:26
d00d785
Compare
Choose a tag to compare

Patch Changes

  • #890 afe8d02 Thanks @danez! - Do not throw error when using namespace specifiers in export statements

@react-docgen/[email protected]

12 Jan 00:26
d00d785
Compare
Choose a tag to compare

Patch Changes

[email protected]

08 Jan 14:58
fd30cbe
Compare
Choose a tag to compare

Patch Changes

@react-docgen/[email protected]

08 Jan 14:58
fd30cbe
Compare
Choose a tag to compare

Patch Changes

[email protected]

12 Nov 19:54
9994b2e
Compare
Choose a tag to compare

Patch Changes

@react-docgen/[email protected]

12 Nov 19:54
9994b2e
Compare
Choose a tag to compare

Patch Changes

[email protected]

19 Oct 15:05
de7b230
Compare
Choose a tag to compare

Major Changes

  • #846
    82154c3
    Thanks @danez! - getTypeFromReactComponent now
    returns an array of paths to types instead of just one. This can appear when
    multiple type definitions are found for a component, for example:

    const Component: React.FC<Props> = (props: { some: string }) => {};

    In this example both the Props definition as well as { some: string } are
    now found and used.

    Here is a simple diff to illustrate the change when using
    getTypeFromReactComponent:

    const type = getTypeFromReactComponent(path)
    
    -if (type) {
    +if (type.length > 0) {
        // do smth
    }
    
  • #848
    dda8915
    Thanks @danez! - Drop support for Node.js
    version 14.

    The minimum supported version is now 16.14.0

  • #846
    62e692f
    Thanks @danez! - resolveToValue will not resolve
    to ImportDeclaration anymore but instead to one of the possible specifiers
    (ImportSpecifier, ImportDefaultSpecifier or ImportNamespaceSpecifier).
    This gives better understanding to which specifier exactly resolveToValue
    did resolve a NodePath to.

    Here is a possible easy fix for this in a code snippet that uses
    resolveToValue

    const resolved = resolveToValue(path);
    
    -if (resolved.isImportDeclaration()) {
    +if (resolved.parentPath?.isImportDeclaration()) {
        // do smth
    }

Minor Changes

  • #862
    40ebb00
    Thanks @danez! - Support PropsWithoutRef,
    PropsWithRef and PropsWithChildren in TypeScript.

    Component props are now detected correctly when these builtin types are used,
    but they do currently not add any props to the documentation.

  • #846
    82154c3
    Thanks @danez! - Add support for React.FC in
    TypeScript.

Patch Changes

  • 6312f2f
    Thanks @renovate[bot]! - update
    dependency @types/doctrine to ^0.0.7

  • #846
    c01d1a0
    Thanks @danez! - Fix detection of react class
    components when super class is imported via named import.

  • #861
    74b6680
    Thanks @renovate! - update dependency
    @types/doctrine to ^0.0.8

  • #846
    0641700
    Thanks @danez! - Remove unnecessary call to
    resolveToValue when trying to find props type from react components.

  • #858
    3be404e
    Thanks @danez! - Fix detection of React.Children
    with ESM imports

@react-docgen/[email protected]

19 Oct 15:05
de7b230
Compare
Choose a tag to compare

Major Changes

  • #848
    dda8915
    Thanks @danez! - Drop support for Node.js
    version 14.

    The minimum supported version is now 16.14.0

Minor Changes

Patch Changes