title: How to dynamically create an icon with flatList React Native
body: <p>I want to sent a icon name by using a prop on the list component. So i can set the right icon on the list by giving the prop icon the icon name. My code is looking like this:</p>
  
  <pre><code>import React from 'react';
  import { Text, View, FlatList } from 'react-native';
  import PropTypes from 'prop-types';
  import styled from 'styled-components/native';
  import { List, ListItem } from 'react-native-elements';
  
  class ListLi extends React.Component {
  constructor(props){
      super(props);
  };
  
  renderRow ({ item }) {
      let node;
  
      React.Children.forEach(item, component =&gt; {
          node = component;
      });
  
    return (
      &lt;ListItem onPressRightIcon title={node} rightIcon={{name:icon}}/&gt;
    )
  }
  
  render () {
    const { children, icon } = this.props;
  
    return (
      &lt;StyledList&gt;
          &lt;List&gt;
            &lt;FlatList
              data={children}
              extraData={icon}
              renderItem={this.renderRow}
              keyExtractor={item =&gt; item.name}
            /&gt;
          &lt;/List&gt;
      &lt;/StyledList&gt;
    )
   }
  }
  
  export default ListLi;
  </code></pre>
  
  <p>The icon prop contains the name of the icon and i want to render this in the rightIcon <code>rightIcon={{name:icon}}</code> any ideas?</p>