MangelMaxime / Fable.Form

https://mangelmaxime.github.io/Fable.Form/
Other
54 stars 10 forks source link

Fable.Form.Simple with pure HTML? #35

Open leolorenzoluis opened 2 years ago

leolorenzoluis commented 2 years ago

I'm trying to understand the code but I'm having a hard time groking it. Could you provide a sample on how to create like simple asHtml with no dependencies and just pure HTML? I'm trying to use Fable.Lit in this scenario.

MangelMaxime commented 2 years ago

Right now, Fable.Form.Simple as a strong dependencies over React

https://github.com/MangelMaxime/Fable.Form/blob/6e6b8059e3d9f8b451de6b5431db84bad0e0cc0a/packages/Fable.Form.Simple/Form.fsi#L761-L766

See how Feliz.ReactElement is hardcorded.

So there is 2 solutions:

  1. Wait for #14 to be fixed
  2. Implements your own Form logic.

Option 2, means re-coding Fable.Form.Simple with Fable.Lit as a strong dependency. In theory, this means copy/paste the code and replacing it Feliz.ReactElement with the equivalent in Fable.Lit. And then, you need to preview the actual implementation of your view.

If you are confused by the .fsi files, just know that they make the module private by default because only what is listed in the .fsi file is made public from the corresponding file.