Closed elie222 closed 5 years ago
I got things working without this package doing something like this:
const Button = styled.div<{ selected?: boolean }>`
background: ${props => props.selected ? 'red' : 'blue'};
`
This package should ultimately be useless with the latest version of styled-components and the latest pre-released typescript version.
@elie222 I had no idea that this could be done, thank you. It looks like this package is redundant now. Thanks for creating it @jacob-ebey 👍
NP, I'm just hoping the styled-components group updates their docs (as I can no longer locate the original issue that sparked this library) or this will never die. There was a fairly long thread on why this wasn't possible before with a link to the typescript fix that allowed a fix.
Thanks for the docs PR @mrmartineau!
Their docs are pretty bad btw. I think the two lines of sample code I stuck above actually do a better job of explaining how it's used.
It looks like that trying to style a custom component (not just div) is still not working? I do have the latest React and SC types packages and TypeScript 3.2.1.
I get this error when using this package:
Any idea?