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
}
我已经尝试了多次尝试,并且有点像 js 菜鸟,我的控制台正在触发日志,所以我知道道具已成功调用该函数,但它没有返回样式
非常感谢任何帮助..
非常感谢
詹姆士