fable-compiler / fable-react

Fable bindings and helpers for React and React Native
MIT License
275 stars 67 forks source link

Make castHTMLNode public for use with Raw.WriteTo #109

Closed thinkbeforecoding closed 5 years ago

thinkbeforecoding commented 5 years ago

Raw.writeTo accepts a HTMLNode while constructed model outputs a ReactElement.

The code already provides a private castHTMLNode function for conversion.

This PR make it public to be used from the outside.

The implementation has also been changed to make it safer. Any non matching input now returns a HTMLNode.Empty instead of throwing an exception.

alfonsogarciacaro commented 5 years ago

Thanks!