Interpolate javascript in html loaded from mongoDB with React

0

The problem is the following: I bring the HTML from MongoDB and charge it in react with: <div dangerouslySetInnerHTML={{ __html: products.content.title }} /> It is displayed correctly. Now, what I want is that in the HTML that I post, I can have variables set such as: <h2>{{ product.title }}</h2> and that when loading them from the database, React I caught them correctly. I am loading the HTML in React with the webpack loader 'html-loader'. Any ideas? link

    
asked by CesarCarbajo 05.05.2018 в 20:49
source

0 answers