question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Preserve Typescript types in output

See original GitHub issue

Hello not sure if I’m understanding well the purpose of this library but when I create a component like:

export type ButtonProps = {
  name: string;
};

export default function Button(props: ButtonProps) {
  return <button>{props.name}</button>;
}

The result is:

export default function Button(props) {
  return <button>{props.name}</button>;
}

or:

import { Component, Input } from "@angular/core";

@Component({
  selector: "button",
  template: `
    <button>{{name}}</button>
  `,
})
export default class Button {
  @Input() name: any;
}

If I want to use mitosis to create my own components library, how I can get the types of my components to be able to expose them?

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:17 (8 by maintainers)

github_iconTop GitHub Comments

3reactions
decadef20commented, May 25, 2022

@decadef20 That would be great! This is a critical and complex feature, so if you do take it on, please reach out with any questions as you build it out, so we can make sure you’re approaching it the same way we are envisioning it and not waste your time rewriting a lot of code. We’re here to help 👍🏽

OK。At first,I plan to implement it on react framework. Make sure what I build out is as expected.

2reactions
PatrickJScommented, Jun 7, 2022

@samijaber can you publish for @originswift-sys

Read more comments on GitHub >

github_iconTop Results From Across the Web

TSConfig Option: preserveWatchOutput - TypeScript
TSConfig. preserveWatchOutput ... How to provide a type shape to JavaScript objects. Narrowing. How TypeScript infers types based on runtime behavior.
Read more >
Preserve functions typing when augmenting an object in ...
I need to perform some transformations on a typescript object while being able to preserve it's full shape. So, I have an object:...
Read more >
TypeScript library tips: Rollup your types! | by Martin Hochel
When authoring a TypeScript library make sure to follow best industry practices like shipping smallest possible files by rollup-ing your ...
Read more >
Preserve original formatting when printing modified nodes
I'm building a source code migration tool that will do some heavy lifting within types & expressions in JS & TS code, and...
Read more >
Methods for TypeScript runtime type checking - LogRocket Blog
Checking a specific value's type at runtime is the primary function of type guards. This helps the TypeScript compiler, which then uses the ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found