Zaid-Ajaj / Feliz

A fresh retake of the React API in Fable and a collection of high-quality components to build React applications in F#, optimized for happiness
https://zaid-ajaj.github.io/Feliz/
MIT License
544 stars 81 forks source link

ReactMemoComponent #468

Closed alfonsogarciacaro closed 2 years ago

alfonsogarciacaro commented 2 years ago

I don't remember if we had this discussion before but it would be very useful to have the option to use React.memo with ReactComponent attribute. This seems to work, I had to use another type because new(memo: bool) constructor conflicted with new(exportDefault: bool). To my surprise F# optional arguments are not compatible with attribute constructors, the other option would be to use .NET optional arguments, as in [<Optional; DefaultParameterValue(false)>] memo

If this looks good, it'd be great to have a release so I can use it in my project :)

Zaid-Ajaj commented 2 years ago

Hi @alfonsogarciacaro this looks great! Sorry for the delayed response 🙏 merged and published, should be ready in Feliz v1.62 any moment now 😄

alfonsogarciacaro commented 2 years ago

Awesome, thank you @Zaid-Ajaj!