JSFiddle - React, Tailwind, and code Playground
JavaScript
$('#googlemaps').on('shown.bs.modal', (function() {
var mapIsAdded = false;
var table = $('#userTable').DataTable();
var data = table.rows().data();
return function() {
if (!mapIsAdded) {
$('.modal-body').html('<iframe src="https://www.google.com/maps/embed/v1/place?key=apikey&q='+data.address+'" width="100%" height="500" frameborder="0" allowfullscreen style="border:0"></iframe>');
mapIsAdded = true;
}
};
})());