I believe you have already found what you were looking for but, I saw this question but no answer, still.

You just need to define a variable outside mapping and while mapping, put an if condition to find what you looking for and then equalize the result to the variable outside.


    let tmpItem; => {
        if ( == "99") {
            tmpItem = mapItem;


It's better to use find, but it is not supported in all browsers. Use reduce instead of map:

var SelectedTopicPage = React.createClass({

    render: function() {
        var selectedId = this.props.selectedId; // id what you need to find
        var topicPage = this.props.topicPages.reduce(function(topic, current) {
            return topic.topic_no == selectedId ? current : topic;
        }, undefined);

        return (
            <SelectedTopicPageMarkup headline={topicPage.headline} key={topicPage.topic_no}>

Related Query

More Query from same tag