$.post(
"http://www.google-analytics.com/collect",
{
v: '1',
tid: 'UA-xxxxxx-1',
cid: 'a7a364d8-0d14-4e77-b637-xxxxxxxxxx',
t: 'item',
ti: '21001',
in: 'товар2',
ip: '300.00',
iv: 'категория2'
},
function(data) {
// do something with data
}
);
class Example extends React.Component {
foo = () => {};
render() {
return <SomeComponent foo={this.foo} />
}
}
class Example extends React.Component {
foo() {}
render() {
return <SomeComponent>{this.foo()}</SomeComponent>
}
}
const instance = axios.create({
baseURL: 'https://some-domain.com/api/',
});
var commonExternals = [{
'Config': "var " + JSON.stringify({
APP_GOOGLE: 'xxx',
APP_APPLE: 'xxx',
URL: "xxx",
DOMAIN: "xxx",
DOMAINS: {
developers: "xxx",
base: "xxx"
}
})
}];
module.exports = commonExternals;
module.exports = {
//...
externals: [].concat(commonExtarnals)
};
render() {
const { data } = this.props;
if (!data.length) return null;
return (
{/* component JSX code */}
);
}
render() {
const { isDataLoaded } = this.props;
if (!isDataLoaded) return null;
return (
{/* component JSX code */}
);
}
render() {
const { isLoading, data } = this.props;
if (isLoading) return <Preloader />;
if (!data) return <EmptyPlaceholder />;
return (
{/* component JSX code */}
);
}
.main__socials {
display: flex;
flex-direction: row;
justify-content: center;
background-color: #222;
padding: 30px;
}