Typescript Components which have props with hyphens generate a syntax error in Python
Open
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 24.4k
- Forks
- 2.3k
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 13
Description
When converting components which have props containing a hyphen, e.g. "aria-expanded", the generated Python class has "area-expander" in its parameters, which throws an invalid syntax error.
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the TypeScript-to-Python component conversion with a prop such as "aria-expanded" and inspect the generated Python class shown in the report. Done means the generated constructor is valid Python while the hyphenated prop remains represented correctly; the issue does not name a source file or test to run.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, typescript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100