I would like to know how to display dynamic script/html content in editor using react (react-froala-wysiwyg). It displays but the dynamic data not working proper shows as ${orderdate!''}
import React from "react";
import 'froala-editor/css/froala_style.min.css';
import 'froala-editor/css/froala_editor.pkgd.min.css';
import FroalaEditor from 'react-froala-wysiwyg';
class AddEmail extends React.PureComponent {
constructor(props) {
super(props);
handleChange =()=>{
this.setState({ emailbody: value });
}
render() {
return (
<React.Fragment>
<div className="form-group col-lg-12 col-sm-12">
<FroalaEditor
model={this.state.emailbody}
onModelChange={this.handleChange}
/>
</div>
</React.Fragment>
);
}
}
}
// Dynamic data from backend data
emailbody: {
<!DOCTYPE html>
<html lang="en">
<head>
<title></title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<p>Order Confirm</p>
${orderdate!''}
</body>
</html>
}