IMAGE_INLINE_SIZE_LIMIT
через переменные окружения.// "url" loader works like "file" loader except that it embeds assets
// smaller than specified limit in bytes as data URLs to avoid requests.
// A missing `test` is equivalent to a match.
{
test: [/\.bmp$/, /\.gif$/, /\.jpe?g$/, /\.png$/],
type: 'asset',
parser: {
dataUrlCondition: {
maxSize: imageInlineSizeLimit,
},
},
},
interface TodoItem {
id: number
subtitle: string
important: boolean
done: boolean
}
const generalToggle = (arr: TodoItem[], id: number, propertyName: keyof TodoItem) => {
const idx = arr.findIndex((item) => item.id === id);
const oldItem = arr[idx];
const value = !oldItem[propertyName];
const item = {...arr[idx], [propertyName]: value};
return [
...arr.slice(0, idx),
item,
...arr.slice(idx + 1)
];
};
function dataPage() {
fetch('example.com')
.then(response => response.json())
.then(data => {
const promises = data.URLs.map(url => fetch(url).then(r => r.json()))
return Promise.all(promises).then((arr) => {
data.arr = arr;
return data;
})
})
.then((data) => {
setState(prevState => {
return (
{
...prevState,
data // вероятно тут спред нужен по логике
}
)
})
})
}
css={`класс`}
выглядит, как emotion css prop.