import * as ReactDOM from "react-dom";
import * as React from "react";

import { CustomComponent } from "./../custom-component";
import { ComponentsRefs } from "./../components-refs";
import { Feed, FeedProp } from "./feed";

export class FeedList extends CustomComponent<{}, FeedListState> {

    feedComponents: Feed[] = [];

    constructor() {
        super();

        this.state = {
            feeds: []
        };

        ComponentsRefs.feedList = this;
    }

    render() {
        return (
            <ul className="rss list">
                {
                    this.state.feeds.map(feed => {
                        return <Feed ref={feed => this.feedComponents[this.feedComponents.length] = feed} key={feed.uuid} uuid={feed.uuid} title={feed.title} link={feed.link} />
                    })
                }
            </ul>
        );
    }

    addFeed(newFeed: FeedProp) {
        const newFeeds = this.state.feeds.slice(0);
        newFeeds[newFeeds.length] = newFeed;
        this.editState({ feeds: newFeeds })
    }
}

interface FeedListState {
    feeds: FeedProp[];
}
import * as ReactDOM from "react-dom";
import * as React from "react";

import { CustomComponent } from "./../custom-component";
import { ComponentsRefs } from "./../components-refs";
import { Feed, FeedProp } from "./../component/feed";

export class FeedList extends CustomComponent<{}, FeedListState> {

    constructor() {
        super();

        this.state = {
            feeds: []
        };

        ComponentsRefs.feedList = this;
    }

    render() {
        return (
            <ul className="rss list">
                {
                    this.state.feeds.map(feed => {
                        return <Feed key={feed.uuid} uuid={feed.uuid} title={feed.title} link={feed.link} />
                    })
                }
            </ul>
        );
    }

    addFeed(newFeed: FeedProp) {
        const newFeeds = this.state.feeds.slice(0);
        newFeeds[newFeeds.length] = newFeed;
        this.editState({ feeds: newFeeds })
    }
}

interface FeedListState {
    feeds: FeedProp[];
}
--- 
+++ 
@@ -3,9 +3,11 @@
 
 import { CustomComponent } from "./../custom-component";
 import { ComponentsRefs } from "./../components-refs";
-import { Feed, FeedProp } from "./../component/feed";
+import { Feed, FeedProp } from "./feed";
 
 export class FeedList extends CustomComponent<{}, FeedListState> {
+
+    feedComponents: Feed[] = [];
 
     constructor() {
         super();
@@ -22,7 +24,7 @@
             <ul className="rss list">
                 {
                     this.state.feeds.map(feed => {
-                        return <Feed key={feed.uuid} uuid={feed.uuid} title={feed.title} link={feed.link} />
+                        return <Feed ref={feed => this.feedComponents[this.feedComponents.length] = feed} key={feed.uuid} uuid={feed.uuid} title={feed.title} link={feed.link} />
                     })
                 }
             </ul>
Add key to array rendering
