Incorrect information about limitation for React Fast Refresh on "Elmish Components with Elmish 4 and UseElmish"
MangelMaxime opened this issue · 1 comments
MangelMaxime commented
In order for React Fast Refresh to work, files must include only one JS export. This means you should only expose one functional component (decorated with
Feliz.ReactComponentorJSX.Component) and the rest of the code in the file must be private.
I think the "files must include only one JS export" is incorrect.
At least when using Feliz + Feliz.UseElmish, you can have several exports.
From my tests and understanding, the limitation for React Fast Refresh is that only ReactComponents should be exposed from the module.
So you can do stuff like:
type Components with
[<ReactComponent>]
static member AnErrorOccured = // ...
[<ReactComponent>]
static member AnErrorOccured(title: string, subtitle: string) = // ...Example taken from Fable.Packages.
alfonsogarciacaro commented
Oh, you're right! Didn't notice that 😅 I corrected it, thanks for pointing it out!