<a style={{ backgroundImage: `url(${(`../assets/images/${posts.image}`)})`}} >
Hi, can someone help me understand what exactly is happening here? Theres way too many symbols here and im lost. What does the first {} do, what the second, why is there a $, why ``. Is there a less confusing way of writing this?
Also i have a thing called posts.style, which is defined like so:
const trendingConfig = {
1:{
gridArea: '1 / 2 / 3 / 3'
}
}
const mergeStyles = (posts: any, config: any): void => {
posts.forEach((post, index: number) =>{
// TODO? if (index)
post.style = config[index];
})
}
and i wanna add it together with the preexisting code i showed in the beginning, how do i do that?