svelte-preprocess-react icon indicating copy to clipboard operation
svelte-preprocess-react copied to clipboard

Improve VS Code support

Open bfanger opened this issue 3 years ago • 2 comments

Would be nice if the props and events would be typed

bfanger avatar Jun 11 '22 21:06 bfanger

Hi, first of all this lib is a saviour.

Related to issue you mentioned above, I'm trying to use new Fluent UI React v9 and a bit stuck on how to use in svelte.

<CompoundButton icon={< CompoundIcon />} secondaryContent="Secondary content"> Example </ CompoundButton> Icon is another react component and setting it gives an error "Unknown directive", and if I remove icon style is not applied...

By any chance, do you have any examples of how it can be used?

Thanks in advance!

osmanium avatar Oct 18 '22 10:10 osmanium

@osmanium You can't use JSX inside a *.svelte file (yet) #16

JSX is a simple transformation, the <CompoundIcon /> transforms into React.createElement(CompoundIcon, null) Try https://babeljs.io/repl for complexer JSX transformations.

I don't have examples of Fluent UI

The <react:CompoundButton icon={React.createElement(CompoundIcon, null)} >Example</react:CompoundButton> is valid syntax for inside a svelte file.

bfanger avatar Oct 18 '22 16:10 bfanger