export const MotionDiv = styled(motion.div)`
background: ${props => props.showSlides ? 'red' : 'blue'};
${({showSlides}) => (showSlides ? ShowSlides() : null)};
`
const ShowSlides = () => {
console.log('show slides function fires')
let styling = ``
setTimeout(() => {
styling = `background: yellow !important;`
}, 100);
console.log('its lit', styling)
return styling
}
I have tried multiple attempts as well as being a bit of a js noob my console is firing the logs so im aware the prop is successfully calling the function however it's not returning the styling
any help greatly appreciated ..
many thanks
james