I have been trying to understand the feasibility of rendering a HTML with CSS styling in Android/iOS. To give some background, we have web presence where based on some user actions, the HTML is generated and rendered. The HTML contains CSS styles (reference W3), attributes, tags (div/span/a), anchor with url and mailto protocol, custom classes, so on and so forth.
The goal is to have good visual fidelity, great performance, code reuse and less maintenance.
Choices we have so far:
- Render the HTML in WebView: Hosting in WebView doesn't look like a great option as it would kill user experience. Plus I've heard WebView doesn't great performance (please correct me of my research is incorrect)
- ReactNative: Parse HTML and map it to ReactNative controls
- Go pure Native
It looks like Android/iOS doesn't directly support CSS. Before I write about the research I have done so far, I need help in couple of questions:
- Does ReactNative cover all CSS styles well? As RN components map to Android/iOS native views, how does the mapping of CSS styles to Android Style props look like?
- Is there a way to use CSS in Android/iOS native directly?
react-native-htmlview takes HTML as input and converts it to RN components. But it doesn't seem to support HTML tags with styles. Is there something (a 3rd party library, or a custom solution) that can be used here?