How to set an ID in react-native-web

Aaron MGDR
1 min readAug 9, 2019

(in hindsight obvious, while trying not so)

So a few months ago, I wanted to set an `id` on a react-native-web (RNW) View component <View id="newsletter"/> But that doesnt work.

Turns out in order to maintain compatibility with ReactNative, RNW uses `nativeID` This is in the docs, but I somehow missed it, until i found this issue

So to set an ID on a view in react native web, which will be mapped to the elements dom node do this

<View nativeID="some-id" />

docs referencing this are here