Add default case option to switchProp
nderscore opened this issue ยท 4 comments
nderscore commented
I think it might be nice to have a default case option for the switchProp()
function. Having a generic else case without having to specifically write out every other possible prop value would be nice. Plus, it makes it closer to mirroring the functionality of an actual switch statement! ๐
I think adding a third optional argument (identical to how prop()
's defaultCase
argument works) would be fine, as it wouldn't break backwards compatibility with current usage of the function.
nderscore commented
Thanks!
diegohaz commented
@mehrad77 Yes! Would you mind sending a PR updating https://github.com/diegohaz/styled-tools/blob/master/src/switchProp.js and running npm run docs