1

I'm pretty sure that I'm missing something basic here, but I can't figure it out. I've been following this tutorial to render a list of elements, but I'm getting a "View Config not Found for name li" error, and for any other HTML element that I attempt to use in render(). Not sure where I'm going wrong here as all other similar questions had solutions that I've already included in my code (like including a return statement), so any advice would be appreciated.

import React, { Component } from 'react'; 
import ReactList from 'react-list';
import { StyleSheet, Text, View, Navigator, AppRegistry, TextInput, 
TouchableOpacity } from 'react-native';
const { createGame, addUserToGame } = require('./requestors');

class Players extends Component {
    constructor(props) {
    super(props);
    this.state = {
        players: [{
            name: 'Player1',
        }, {
            name: 'Player2',
        }],
    };
  }

  render() {
    return (
        <ul>
        {this.state.players.map(player => <li>{player.name}</li>)}
        </ul>
      );
  }
}

module.exports = Players;
Rohan Varma
  • 41
  • 1
  • 5

1 Answers1

3

you cant render html component in react-native

Jigar
  • 1,314
  • 9
  • 19
  • 1
    why negative voting? that's true you cant render html element in native unless you use webView – Jigar Dec 05 '17 at 10:15
  • 1
    because while flatly true, it lacks any substance to push either the original asker or anyone else forward to an actual solution. It reminds me of the Babylon 5 quote - "While all answers are replies, not all replies are answers." – RonLugge May 07 '18 at 22:09