Skip to content

Enhancement: Automatic Global JSX Declaration in "beyond-widget" Package #2

@jircdev

Description

@jircdev

Problem:

Currently, in our codebase, we face a TypeScript error when using the custom JSX element <beyond-layout-children/>. TypeScript reports the error: "Property 'beyond-layout-children' does not exist on type 'JSX.IntrinsicElements' (ts(2339))."

Context:

To address this issue, we've been manually adding a global JSX declaration for "beyond-layout-children" in our templates. While this solution works, it has some drawbacks:

  • It requires developers to remember to include this declaration in every template that uses "beyond-layout-children," which can be error-prone and time-consuming.
  • It may lead to inconsistencies in the declaration across different parts of our codebase.

Proposed Solution:

The goal is to enhance the "beyond-widget" package to handle this global JSX declaration automatically. By doing so, we can eliminate the need for developers to include it manually in templates. This improvement will offer several advantages:

  • Streamline Development: Developers won't need to remember to add the declaration, making the development process smoother and more efficient.
  • Maintain Consistency: With the declaration handled by the package itself, we can ensure consistent usage and typing of "beyond-layout-children" across our codebase.
  • Reduce TypeScript Errors: By centralizing the declaration, we reduce the potential for TypeScript errors related to JSX elements.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions