Known typescript sub-typing issues #207
Copy link
Copy link
Closed
Labels
documentationPull requests that update project documentationPull requests that update project documentationenhancementhelp wanted
Description
Activity
- addeddocumentationPull requests that update project documentationPull requests that update project documentation
on Nov 24, 2022 - pinned this issue
on Nov 24, 2022 - locked and limited conversation to collaborators
on Apr 15, 2024 - unpinned this issue
on May 6, 2024
Metadata
Metadata
Assignees
Labels
documentationPull requests that update project documentationPull requests that update project documentationenhancementhelp wanted
Expected Behavior
Typescript gets smart.
Actual Behavior
Typescript is not smart.
Steps to Reproduce the Problem
src/components/ReactP5WrapperGuard.tsx.src/components/ReactP5WrapperWithSketch.tsx.as unknown as Tshenanigans.The
as unknown as Tcasts are begrudgingly required due to a known limitation of the TypeScript compiler as demonstrated in the following issues for example:As Ryan Cavanaugh points out:
Potentially this would have been resolved by this PR but the author closed it due to lack of time:
Perhaps someone interested in the topic and who has time to work on it would be willing to take a look into the issue.
Either way, until a resolution is merged into the TypeScript compiler that addresses this issue, we need to use this workaround. We could also remove this if we manage find a reasonable, more fitting workaround of some sort to avoid casting in the first place. If a workaround / change of implementation comes to mind, please raise an issue on the repository or feel free to open a PR!
Specifications
Package Version: 4.0.0 and above