<SomeComponent hover={this.state.hover} data={item.data}/>
<Route
path='/publishedArticlePage'
render={ (props) => <PublishedArticlePage {...props} article={article} }
/>
state = { loaded: false, data: null }
const getData = () => new Promise(resolve => {
setTimeout(() => resolve( {data: 177} ), 2000)
})
...
getData().then(d => {
// что то делаем с данными, например
this.setState( { loaded: true, data: d } )
})
render() {
if (!this.state.loaded) return <Loading />
return <MyBeautifulDataComponent />
}
$('#modal_form1').submit(function(){
var form = $(this);
var data = form.serialize();
form.find('input[type="submit"]').attr('disabled', 'disabled');
$.ajax({
type: "POST",
url: "mailer/smart3.php",
data: data
}).done(function() {
// выключаем субмит у формы
form.attr('disabled','disabled');
form.find("input").val("");
$('#callModal1').modal('hide');
$("#modal_form1").trigger("reset");
});
return false;
});