Fakefish
Fakefish

Reputation: 315

what is Unknown in react-native

I did not put any undefined variables in the view but it appear some Unknow tags,so I wonder what is Unknown there?

<View> <View style={styles.row}> <Text>{rowData.user.name}&middot; {rowData.createdDate}</Text> <Text>{rowData.title}</Text> </View> <View style={styles.separator} /> </View>

in chrome I seen between the View and Text there is a Unknown.

Upvotes: 0

Views: 965

Answers (2)

Colin Ramsay
Colin Ramsay

Reputation: 16466

I wonder if this is due to text nodes in your code, specifically white space like tabs and newlines. Please see this issue from the react dev tools:

https://github.com/facebook/react-devtools/issues/44

There are several such issues on the devtools tracker, sometimes related to a lack of displayName on components but I don't see how that applies here.

Suggest opening an issue on the React Native Github tracker as I doubt this is expected. Someone on the RN team might be able to give us a better explanation.

Upvotes: 1

Tyler McGinnis
Tyler McGinnis

Reputation: 35276

Did you define Text and View?

At the top of your file you should have something like this,

ES6

var {
  View,
  Text,
} = React;

ES5

var View = React.View;
var Text = React.Text;

Upvotes: 0

Related Questions