Skip to content

dash component generation doesn't work for hyphenated props #2843

Open

Description

@tsveti22

When generating new components using the dash typescript boilerplate, there is an issue with props containing a hyphen. E.g., if I try to generate bindings for a component, which has the "aria-expanded" prop, the generated Python class has "area-expanded" in its parameters, which throws an invalid syntax error, since python variables can't have hyphens.

def __init__(self, children=None, value=Component.REQUIRED, aria-expanded=Component.UNDEFINED, **kwargs):
        self._prop_names = ['children', 'id', 'about', 'accessKey', 'aria-expanded', ]

SyntaxError: invalid syntax

Activity

  1. AnnMarieW commented on May 4, 2024

    @AnnMarieW
    Collaborator

    This topic has been around a long time. Just thought I'd consolidate a couple issues and forum posts that might be helpful - just in case it gets on the roadmap or sponsored.

  2. changed the title [-][BUG] The dash component generation doesn't work for hyphenated props[/-] [+]dash component generation doesn't work for hyphenated props[/+] on Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3backlogbugsomething broken

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions