Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Is this true? React native for ios and android draw with native widgets, not a DOM.


It is not.

Here's the GitHub for the Windows implementation: https://github.com/microsoft/react-native-windows

And here's the fork of React Native for the Mac one (it doesn't seem to be as polished as the Windows one yet): https://github.com/microsoft/react-native-macos


I would be very surprised if they didn't use any pieces used by Edge (how else would they render css?). A quick search of their code though and I couldn't find it. Perhaps I assumed too much


It doesn't render CSS, not in that context. The way styling for layout and for colour/text/etc is specified is designed to match a subset of CSS so that developers can easily transition across to the platform, that's all (and for layout it uses an engine called Yoga, which implements CSS' flexbox spec). So in the context of actual component code, it's a layer designed to look like CSS that can generate whatever the backend being used requires to render (so it should be able to produce valid CSS as an output, as in the case of React Native Web)


React native doesn't really use css - there are no .css files, no cascading either. It's more like a style engine that uses a subset of css ideas as a starting point.

It uses flex-box (and only flex-box) for layout, adds some convenient shorthands - marginVertical, marginHorizontal, and does some surprising (but useful) things like has transform take a JS array of key value pairs - https://reactnative.dev/docs/transforms#transform


They do a translation between CSS/flexbox and the native UI layer, just like on iOS and Android




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: