Dear community,
I've been struggling to integrate Calcite Design System in a React project with TypeScript. I followed the instructions, "calcite-components" is imported in my entry file, as well as the CSS and the components are working, but I don't get any typings. I see red squiggly lines in VS Code all over the place and the error message says "Property 'calcite-<element>' does not exist on type 'JSX.IntrinsicElements'."
Things I tried (with no success):
My basic understanding is that there's a mapping from the calcite tags to the interfaces. The same thing btw happens in "preact.d.ts", as far as I can see. But somehow, in my React project, TypeScript doesn't see the JSX tags from "components.d.ts".
And then there's Stencil underneath, and I found an issue related to what I see: https://github.com/ionic-team/stencil/issues/1090. Tried the suggested fixes, but no luck.
Final notice: My calcite components are working, but I can only connect the events by dom. Is that intended?
Cheers
Nik
@JuliePowell Do you know someone who can help?
Solved! Go to Solution.
Hi @JuliePowell,
I found a Github issue about @paulcpederson implementing this for Preact and it turns out, my problem was solved a week ago, yay 🎉
This is the link: https://github.com/Esri/calcite-components/issues/2336
Thanks!
Hi Nik,
I will try and get you some help; I don't know the answer to this one. Stay tuned...
Julie
Hi @JuliePowell,
I found a Github issue about @paulcpederson implementing this for Preact and it turns out, my problem was solved a week ago, yay 🎉
This is the link: https://github.com/Esri/calcite-components/issues/2336
Thanks!
ESRI documentation in this matter, as always on every matter, is absolute garbage. For the life of me I can't even Loader to work with React, Typesript and this new component system to work. I have followed everything to the letter but when I try to import the loader (import CalciteLoader from bla bla lba calcite-components-react") I just get some bs like this:
Property '"label"' is missing in type '{ text: string; }' but required in type 'CalciteLoader'. TS2741
I was trying to use the calcite-components-react. I was not trying to use loader as in component loader. I was trying to use Loader animation component as in CaliciteLoader (formelly known simply as Loader). I was using the Loader which was the "previous version" of the component but it started to fail (animation stuck inside some other components) and I was trying to "upgrade" but didn't want to fight with this new one and decided to go with MUI because I wasn't using Calicite for anything else anyway... So again, not the component loader - the loader animation web component
Oh I see. Sorry to hear that. Quick test:
<CalciteLoader active text="loading" label="labelling"></CalciteLoader>
Not quite sure but I don't believe documentation mentioned label been mandatory prop. But maybe next time I'll get it to work. Thanks