Freelance Project Requests info@CodeDocu.de Software Development in C# WPF Asp.Net Core Vba Excel Word SQL-Server EF Linq, UWP Net
#

React in Image src='path'

 

Problem:

React uses the output of als text

 

<img src="{article.imagePath}" alt="{article.title}"

 

Generated in HTML output in the browser

 

<img src="{article.imagePath}" alt="Kontakt Adresse Email Telefon" class="list_img">

 

 

Solution in React

You don't have to insert an e commas inReact, just the React bracket. Expression because the commas are automatically inserted by the compiler

Right:

 

<img src={article.imagePath} alt={article.title} class="list_img" />

 

 

Solution: React.js Code

    //========< Fill HTML >======

    static renderTable(articles) {

        return (

            <div id="divMain_List" class="list_Div_Main" >

                {articles.map(article =>

                    <div class="list_Div_Row">

 

                        <a href="{article.title}" title="" class="list_href">

                            <div class="list_folder">{article.folder}</div>

                            <div class="list_title">{article.title}</div>

                            <div class="list_div_img">

                                <img src={article.imagePath} alt={article.title} class="list_img" />

                            </div>

                            <div class="list_div_text">

                                {article.textContent}

                            </div>

                        </a>

                    </div>

 

                )}

            </div>

        );

    }

    //========</ Fill HTML >======

 

 

Correct after React Change

                                     

Mobile

.

Contact for Jobs, Project Requests: raimund.popp@microsoft-programmierer.de