React-native: React Native Android - Single/Multiline comments throws error

Created on 18 Sep 2015  路  3Comments  路  Source: facebook/react-native

If I put a single or multiline comment inside a <View> enclosure throws an error Trying to add unknown view tag: and what looks like an array map of the tags.

screen shot 2015-09-17 at 3 13 00 pm

Also found that if I use a multiline comment, the interpreter still renders the commented out elements

Such as

/*
   <View>
      <Image source={require('image!bg_splash')} style={{}} />
   </View>
*/

I still received unknown module 'image!bg_splash' during my last issue #2808

Locked

Most helpful comment

This is how JSX works (independent of React Native). JSX does not support comments - you need to push them in to JS, ex: {/* comment */}

All 3 comments

This is how JSX works (independent of React Native). JSX does not support comments - you need to push them in to JS, ex: {/* comment */}

Got it. Thank you.

Just curious, does this create any performance overhead?

Was this page helpful?
0 / 5 - 0 ratings