-
Notifications
You must be signed in to change notification settings - Fork 788
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Typings not valid in React/Typescript app #693
Comments
Could you provide an example repo that reproduces this issue? I realize that most likely the code involved is provided above and at first glance it looks fine, so I believe that a simple reproduction in a small repo would help a lot. Thanks! |
@jthoms1 OK, I've created two repos:
In the react/tsx app, pay attention to the Note: I had to shim the component into the node_modules via the Thanks in advance for your help! Let me know if I can provide you any additional info! |
In the coming weeks I will be spending more time on getting React to play nice with Web components produced by Stencil. I created a simple shim early on in the project that should still work. There are a number of known issues with React and web components and my shim was to work around those issues. There is an open RFC for web components in react but seems not to be moving very fast. reactjs/rfcs#15 |
@jthoms1 Thanks for the shim, I'll check it out! Didn't realize the problem was larger than stencil, but this makes sense. Any guidance/docs stencil can provide on integrating with React/Typescript would be really helpful. Really appreciate your help on this issue! |
Thanks for the issue! This issue is being closed due to inactivity. If this is still an issue with the latest version of Stencil, please create a new issue and ensure the template is fully filled out. Thank you for using Stencil! |
Stencil version:
I'm submitting a:
[ ] bug report
[ ] feature request
[X] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or https://stencil-worldwide.slack.com
Current behavior:
I'm trying to integrate my Stencil components into a React/TypeScript project (as a 3rd party dependency). It appears that the custom elements are implemented in a way that does not match the
d.ts
that is produced by the stencil build. Is there a way to reference thed.ts
version and not the raw HTML?Also, what is the correct way to "Listen" to Events from a stencil built component in a React/TypeScript template? There seems to be a lot of boiler-plate involved.
(Code below)
Expected behavior:
If I'm importing a component into a React/Typescript project, I would expect to interact with the component via the
d.ts
, and not the raw HTML. Also, I would expect the event binding to be per the interface and docs, not registering and eventListener.Related code:
hello-world.tsx
Components.d.ts
React/Typescript/TSX - App.tsx
I would expect that I would call the component like this from the React/TSX:
<hello-world name="NAME" onHelloWorldName={this.someMethod} />
Other information:
The text was updated successfully, but these errors were encountered: