Skip to content

Error with reserved word pattern in dash-generate-components when converting Ant Design React components #3079

Closed
@C0deBeez

Description

@C0deBeez

Description: When trying to convert Ant Design React components to Dash components using dash-typescript-components-boilerplate, the following errors are triggered:

ERROR: "internalDisableMenuItemTitleTooltip" matches reserved word pattern: /^.$/
ERROR: "internalRenderMenuItem" matches reserved word pattern: /^.
$/
ERROR: "internalRenderSubMenuItem" matches reserved word pattern: /^.*$/

Details: After investigating, it appears that the error is due to the underlying dependency in Ant Design's menu implementation, which relies on the rc-menu project. Specifically, rc-menu has _internalRenderMenuItem and other internal related methods that match Dash's reserved word pattern /^.*$/.

Since these methods are part of the rc-menu internals, it appears Dash's reserved word patterns are causing conflicts during the conversion process.

Steps to Reproduce:

Set up a Dash project with dash-generate-components.
Attempt to convert Ant Design components (especially Menu related components) using dash-generate-components.
Observe the errors related to reserved word patterns in the output.
Expected Behavior: The components should be generated without error or provide a way to handle these internal methods without conflicting with Dash’s reserved patterns.

Environment:

Dash version: 2.18.2
Ant Design version: 5.22.0
rc-menu version: 9.16.0

Would it be possible to provide an option to ignore or handle internal methods that start with an underscore (_) to avoid conflicts with Dash's reserved patterns?

Thank you for your assistance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2considered for next cyclebugsomething broken

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions