document.getElementById('prldr').style = 'display: fixed;';
export default function delerePreLoad() {
document.getElementById('prldr').style = 'display: none;';
}
let responseIp = await fetch(`https://ipinfo.io/json?token=${process.env.IP_INFO_TOKEN}`);
responseIp = await responseIp.json();
window.console.log(responseIp);
const path = require('path');
var config = Encore.getWebpackConfig();
config.node = { fs: 'empty' };
module.exports = {
entry: ['@babel/polyfill', './src/index.js'],
mode: 'development',
output: {
filename: 'main.js',
path: path.resolve(__dirname, 'dist')
},
class Table extends Component {
render() {
const data = this.props.info;
return (
<Grid
container
className="developer_block-time_feature time_feature_block"
>
<Grid container className="table_title">
<TitleColumn props={this.props} title="Name" />
<TitleColumn props={this.props} title="Job" />
<TitleColumn props={this.props} title="City" />
<TitleColumn props={this.props} title="Country" />
<TitleColumn props={this.props} title="Latitude" />
<TitleColumn props={this.props} title="Longitude" />
<TitleColumn props={this.props} title="Date" />
</Grid>
{data.map((elem, index) => (
<FixedSizeList <------- Теперь компонент тут
className="List"
height={250}
itemCount={111}
itemSize={35}
width={300}
key={elem.id}
>
<Grid container className="table_row">
<Grid item xs={1}>
<Box className="table_elem name_elem">{elem.name}</Box>
</Grid>
<Grid item xs={1}>
<Box className="table_elem job_elem">{elem.job}</Box>
</Grid>
<Grid item xs={1}>
<Box className="table_elem city_elem">{elem.city}</Box>
</Grid>
<Grid item xs={1}>
<Box className="table_elem country_elem">{elem.country}</Box>
</Grid>
<Grid item xs={1}>
<Box className="table_elem latitude_elem">{elem.latitude}</Box>
</Grid>
<Grid item xs={1}>
<Box className="table_elem longitude_elem">{elem.longitude}</Box>
</Grid>
<Grid item xs={1}>
<Box className="table_elem date_elem">
{`${elem.date.toLocaleString("en", {
year: "numeric",
month: "long",
day: "numeric"
})}`}
</Box>
</Grid>
</Grid>
</FixedSizeList> <------- Теперь компонент тут
))}
</Grid>
);
}
}
Вынести функцию в методы жизненного цикла, если она должна вызываться один раз