fable-compiler / Feliz.JSX

Feliz API for JSX compilation
MIT License
31 stars 1 forks source link

Third Party JSX support. #2

Closed kunjee17 closed 1 year ago

kunjee17 commented 1 year ago

Hi, there are many third party libraries for react and solidjs. Until now we need to write wrapper around it. And it is still the way to go for most libraries.

But is is possible to include third party jsx code? If yes how to do import for same?

MangelMaxime commented 1 year ago

It seems like you can't yet import the type from F# because of deduplicate feature of F# https://github.com/fable-compiler/Fable/issues/2912.

However, I support that when Fable see JSX code it just doesn't touch the code and so you can write valid JSX in it.

Looking at this issue https://github.com/fable-compiler/Fable/issues/3237 we can see someone using import directly from the JSX code because it valid JSX/JS code.

JSX.jsx
            $"""
        import {{ Input, Button }} from "react-chat-elements"
        <Input
            placeholder="Type here to send a message."
            defaultValue=""
            referance={inputRef}
            ....
kunjee17 commented 1 year ago

@MangelMaxime Thanks I ll check that and close the issue afterwords. thanks a lot for reply

kunjee17 commented 1 year ago

Import failing at compilation part. Not working sadly. :( . Still working on work around

kunjee17 commented 1 year ago

I ll close this issue as I was able to write small wrapper and moved most of the code in tsx file.