I have some react Code
onFinish = value => {
fetch(`filter?layout=false&q[city_id_eq]=${this.state.value}`, {
method: 'GET'
})
.then(response => response.text())
.then(content => document.getElementById('filter-content').innerHTML = content)
};
It works, BUT the problem is this line:
.then(content => document.getElementById('filter-content').innerHTML = content)
no scripts can be inserted with .innerHTML or there are ways around, which seem to be super complicated, like here Can scripts be inserted with innerHTML?
I am new to React and I am looking for a way to load HTML including the script I have (which is a map, having around 50 lines of code. More complicated, it's map written in a ruby file... ) Please help, none of the suggested options in the link above helped so far. I kind of need to look for script-Tags in my #filter-content and load them into the Page content.